From 965c08d8c053996779a6f94e1ea5c3c1863907cd Mon Sep 17 00:00:00 2001 From: Thom May Date: Tue, 2 Sep 2008 17:59:59 -0400 Subject: Slight denormalisation to store a host's environment as a first class object in the database Fixes: #1392 --- lib/puppet/rails/host.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/puppet/rails/host.rb') 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 -- cgit