(#4487) When setting environment on a host, ensure it is a string.
Before this change when environment strings were read out of the storeconfigs
database, they were eventually converted up to Puppet::Node::Environment
objects. When these objects are returned to the storeconfigs database,
ActiveRecord dumps them as YAML, which begins the death-spiral of YAML.
This change makes it so the host will always store the environment as a string,
preventing the Puppet::Node::Environment object from being YAMLized, and stored
as such in the database.
This change was based on one by Richard Crowley.
Paired-with: Jacob Helwig <jacob@puppetlabs.com>
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
Signed-off-by: Richard Crowley <r@rcrowley.org>