-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Derived attributes incorrectly implemented #79
Comments
@kbaltrinic thanks. Neat article!! It was written before chef client 12 was released, I wonder if it's still applicable. |
I was discussing the problem with some of the Chef team at a local meetup and they were the ones to point me to it. It might be going a bit far to call it the "official" approach to the problem but I am pretty sure its still current an valid. |
We fundamentally cannot fix it without inverting the order of attributes files parsing and breaking other use cases (which we won't ever do). Noah's suggestion looks good, the delayed interpolation operator looks like it's supported back to ruby 1.9.3 at least. Its also possible to just use plain old ruby variables at compile-time in order to get the same result: Also, this cookbook exposes resources, and the recipes are trivial. Users are encouraged to not use the recipes in this cookbook at all, and write their own recipes and design their own systems of the attributes they need, if they actually have a requirement for them. |
Any chance anybody could take a look at #89 ? |
Thanks @scalp42 for your contributions. Released cookbook 4.3.7 should resolve this problem. Updates to documentation forthcoming. |
I just learned how to do this correctly myself so don't take this harshly, but the implementation of the derived ['git']['url'] attribute on Line 6 of attrbutes/default.rb is problematic. The following article details why and how to fix: https://coderanger.net/derived-attributes/
Regards
The text was updated successfully, but these errors were encountered: