Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use Chef::Node-friendly semantics for chef_environment #181

Merged
merged 1 commit into from Oct 2, 2012

Conversation

Projects
None yet
2 participants
Contributor

nickmarden commented Oct 2, 2012

Chef::Node uses a single function #set_or_return to manage the chef_environment
instance variable, but Ironfan::Provider::ChefServer::Node uses delegation
through #chef_environment and #chef_environment=. Unfortunately, magic in the
Chef mixins causes #chef_environment to go through the "correct" get/setter
while the call to #chef_environment= gets stashed uselessly in self's Hash
representation (rather than an instance variable of self). The net result is
that the attempt to copy server.environment into a new Node's chef_environment
attribute was getting silently dropped on the floor, and all new nodes were
being created in the _default environment :-(

This patch fixes that disconnect, and also allows nice folks to use symbols
for their Chef environment names if that sort of thing makes them happy.

@nickmarden nickmarden Use Chef::Node-friendly semantics for chef_environment
Chef::Node uses a single function #set_or_return to manage the chef_environment
instance variable, but Ironfan::Provider::ChefServer::Node uses delegation
through #chef_environment and #chef_environment=. Unfortunately, magic in the
Chef mixins causes #chef_environment to go through the "correct" get/setter
while the call to #chef_environment= gets stashed useless in self's Hash
representation (rather than an instance variable of self). The net result is
that the attempt to copy server.environment into a new Node's chef_environment
attribute was getting silently dropped on the floor, and all new nodes were
being created in the _default environment :-(

This patch fixes that disconnect, and also allows nice folks to use symbols
for their Chef environment names if that sort of thing makes them happy.
da70026

@temujin9 temujin9 added a commit that referenced this pull request Oct 2, 2012

@temujin9 temujin9 Merge pull request #181 from nickmarden/nick/set_chef_environment_per…
…_chef_semantics

Use Chef::Node-friendly semantics for chef_environment
45026fa

@temujin9 temujin9 merged commit 45026fa into infochimps-labs:master Oct 2, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment