infochimps-labs/ironfan — pull request #181 by nickmarden (2012-10-02 06:16:47+00:00)
Title: 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.