summaryrefslogtreecommitdiffstats
path: root/lib/puppet/rails/host.rb
diff options
context:
space:
mode:
authorThom May <thom@clearairturbulence.org>2008-09-02 17:59:59 -0400
committerThom May <thom@joost.com>2008-11-26 15:16:00 -0500
commit965c08d8c053996779a6f94e1ea5c3c1863907cd (patch)
tree6a04a54bc9fe734cf9e5f92d01e031f445e4fcf4 /lib/puppet/rails/host.rb
parent5742966d79206cb5f26cc61c20b065df876f540e (diff)
downloadpuppet-965c08d8c053996779a6f94e1ea5c3c1863907cd.tar.gz
puppet-965c08d8c053996779a6f94e1ea5c3c1863907cd.tar.xz
puppet-965c08d8c053996779a6f94e1ea5c3c1863907cd.zip
Slight denormalisation to store a host's environment as a first class
object in the database Fixes: #1392
Diffstat (limited to 'lib/puppet/rails/host.rb')
-rw-r--r--lib/puppet/rails/host.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/rails/host.rb b/lib/puppet/rails/host.rb
index 626edaa88..187dc657a 100644
--- a/lib/puppet/rails/host.rb
+++ b/lib/puppet/rails/host.rb
@@ -43,6 +43,10 @@ class Puppet::Rails::Host < ActiveRecord::Base
host.ip = ip
end
+ if env = node.environment
+ host.environment = env
+ end
+
# Store the facts into the database.
host.setfacts node.parameters