(PUP-1118) Convert environment for nodes on load
The environment for a Puppet::Node instance is turned into simply the
name of the environment when the Puppet::Node is serialized. Since we
then load the Puppet::Node back in using YAML, and YAML uses the magic
of type annotations to re-create the Puppet::Node instance, the
environment that ends up being set on the Puppet::Node instance isn't
an instance of Puppet::Node::Environment, but is a String.
Since the Puppet::Node doesn't get a callback during deserialization, we
added a fixup method to the Puppet::Indirector::YAML implementation so
that the node object can be fixed up before being handed out to the big,
bad world.
The other choice was to use safe_yaml to load the file and then do the
conversion, but safe_yaml is significantly slower than just plain yaml
and we decided to avoid the performance hit.