summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2009-11-05 20:20:35 +0100
committerJames Turnbull <james@lovedthanlost.net>2009-11-07 08:32:28 +1100
commitcb3e5e10d76a4a0f44e16c5bf36c69b65ae18fbb (patch)
tree869867dd7b98a36a08e30cac9c941fa59b9a6c77 /lib/puppet
parentff23b5762532ef9bec84f0ad5cb32c807e048b90 (diff)
downloadpuppet-cb3e5e10d76a4a0f44e16c5bf36c69b65ae18fbb.tar.gz
puppet-cb3e5e10d76a4a0f44e16c5bf36c69b65ae18fbb.tar.xz
puppet-cb3e5e10d76a4a0f44e16c5bf36c69b65ae18fbb.zip
Fix #2787 - Storeconfig doesn't store/update node ip and environment anymore
Since the storeconfig refactoring (ie moving the catalog storeconfig system under the indirector) in 0.25 we lost the capability to store the node ip and node environment name. This patch restores this feature. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/indirector/catalog/active_record.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/puppet/indirector/catalog/active_record.rb b/lib/puppet/indirector/catalog/active_record.rb
index e3b56ece6..575ce72fb 100644
--- a/lib/puppet/indirector/catalog/active_record.rb
+++ b/lib/puppet/indirector/catalog/active_record.rb
@@ -30,6 +30,11 @@ class Puppet::Resource::Catalog::ActiveRecord < Puppet::Indirector::ActiveRecord
host.merge_resources(catalog.vertices)
host.last_compile = Time.now
+ if node = Puppet::Node.find(catalog.name)
+ host.ip = node.parameters["ipaddress"]
+ host.environment = node.environment
+ end
+
host.save
end
end