Skip to content
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

Closed
kbaltrinic opened this issue Aug 27, 2015 · 5 comments
Closed

Derived attributes incorrectly implemented #79

kbaltrinic opened this issue Aug 27, 2015 · 5 comments

Comments

@kbaltrinic
Copy link

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

@vinyar
Copy link
Contributor

vinyar commented Sep 3, 2015

@kbaltrinic thanks. Neat article!! It was written before chef client 12 was released, I wonder if it's still applicable.

@kbaltrinic
Copy link
Author

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.

@lamont-granquist
Copy link

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:

sous-chefs/erlang#35

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.

@scalp42
Copy link
Contributor

scalp42 commented Feb 1, 2016

Any chance anybody could take a look at #89 ?

@iennae
Copy link
Contributor

iennae commented Feb 4, 2016

Thanks @scalp42 for your contributions. Released cookbook 4.3.7 should resolve this problem. Updates to documentation forthcoming.

@iennae iennae closed this as completed Feb 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants