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

use node array to refer to variables #189

Merged

Conversation

jedineeper
Copy link
Contributor

I use this cookbook via the "include_recipe 'consul'" method as I include this in one of my "base-server" cookbooks.

When I try to pass atlas autojoin/cluster/token variables through my cookbook the variables are not picked up by consul. I had a look through the code and found that the variables were referenced via "node.consul.atlas_autojoin" rather than "node['consul']['atlas_autojoin']". I'm not sure if there was a particular reason for this but changing it like this means the variables are picked up correctly.

@shanesveller originally wrote this in #135 not sure if there was a reason you referenced the variables this way Shane so happy for commentary if there was a particular reason :)

Tests still pass correctly, though I'm not sure how to word a test to cover this particular case?

Thanks,
Craig

@shanesveller
Copy link
Contributor

Square-brackets notation and dot notation for attributes is a stylistic choice and should behave mostly identically in either case. If you're seeing otherwise, that sounds like a bug. It's been some months since I wrote that code, but I actually do prefer square-brackets notation in my personal work. Odds are I was matching other code in this cookbook due to a FoodCritic rule or something of that nature - I can't think of why else I would write it this way.

@jedineeper jedineeper force-pushed the b-atlas-params-not-picked-up branch from 5ac28c7 to 65bc614 Compare July 5, 2015 14:57
@jedineeper
Copy link
Contributor Author

rebased on master 5 July 2015.

johnbellone added a commit that referenced this pull request Jul 6, 2015
@johnbellone johnbellone merged commit 3e58bdb into sous-chefs:master Jul 6, 2015
@jedineeper jedineeper deleted the b-atlas-params-not-picked-up branch July 6, 2015 13:24
@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants