Comments (6)
Pretty sure there isn't anything unexpected here - if the attribute check is moved into the recipe as opposed to the attributes I'm pretty sure you'd get the desired effect. Try that and let us know - at least as I read this there isn't anything wrong so much as the order of operations should simply be changed.
from ohai.
Thanks for your suggestion, it surely "works", but this is not the described scenario ... I want to use my attribute in the attribute file. I don't want to move it to the recipe, I want the ohai attributes available in attributes phase, which seems to me normal.
For me, attributes files are here to compute attributes at certain time in the process, I don't want to compute my attributes in recipes, otherwise it breaks the flow, and the cookbook depending on me won't be able to rely on my attributes.
To rephrase my question:
I want to have access to custom ohai plugin's attributes inside attributes file; is there any other way than changing the
Ohai::plugin_path
using thechef-client
cookbook?
from ohai.
What do you mean by the "attributes phase"? This cookbook isn't going to change how ohai works. The error you are pasting in here is around test kitchen + ohai.
from ohai.
@iennae the example I give you is a repro in kitchen yes.
When I talkk about attribute phase
, I'm trying to name the phase when the attributes are compiled.
I'll try to explain in a different way, let's say cookbook B depends on an ohai attribute defined in cookbook A
- ohai runs
- A attributes are compiled
- B attributes are compiled
... other stuffs are done - A recipe is included and compiled
- B recipe is included and compiled
In this example, the "attribute phase" starts after 1. and ends before 4.
During this phase, because my ohai plugin is not in the plugin_path
, it has not been loaded at step 1.
So in step 3. B attributes won't be able to compute a value based on the ohai plugin
Is it clearer this way?
from ohai.
@Annih, if I understand the docs, you need to specify depends 'attributename'
in ohai plugin you want to be able to consume an attribute within.
from ohai.
Thanks @mikemol for your answer, but in my case I'm not in a ohai plugin, I'm using the result of a plugin in attributes files.
from ohai.
Related Issues (20)
- chefspec tests broken HOT 2
- undefined method `config' for Ohai:Module HOT 1
- Ohai 4.0.1 error on windows.
- allow to specify a cookbook for plugin template/cookbook-file resources HOT 2
- Plugin path check is always case-sensitive
- error executing ohai_plugin HOT 2
- missing node attributes HOT 1
- ohai plugin_path logic doesn't work with Chef local mode HOT 4
- NameError: No resource, method, or local variable named desired_plugin_path HOT 4
- Ohai plugin_path comparison does not handle different path separators HOT 3
- v5.0.1 not on Supermarket HOT 1
- Release 5.0.1 is broken HOT 8
- This cookbook is currently broken in 5.0.1
- AMZ linux and chef 13 ohai hints issue HOT 6
- Interesting Plugin Error with Chef 13 HOT 10
- Getting undefined local variable or method when using `ohai` cookbook with chef 14 HOT 1
- Ohai and plugin paths with subdirectories has validation issues HOT 4
- Error on Ohai 5.2.3 - ohai/plugin_helpers.rb is a version 6 plugin. Version 6 plugins are no longer supported by Ohai. HOT 1
- spec_helper.rb HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ohai.