summaryrefslogtreecommitdiffstats
path: root/lib/puppet/rails/host.rb
diff options
context:
space:
mode:
authorJeffrey J McCune <jeff.mccune@northstarlabs.net>2007-09-10 15:27:57 -0400
committerJeffrey J McCune <jeff.mccune@northstarlabs.net>2007-09-10 15:27:57 -0400
commite826453107fc3888da4667be9cce9cb7661072f8 (patch)
tree92878fa77a20bd76b27ad34507f4f32274ee1ff2 /lib/puppet/rails/host.rb
parent09f7da5a5000876e03e9103c76089cfad9a1ba88 (diff)
parent6700adcacdec4381ee4a27a215ee4b45207aa448 (diff)
downloadpuppet-e826453107fc3888da4667be9cce9cb7661072f8.tar.gz
puppet-e826453107fc3888da4667be9cce9cb7661072f8.tar.xz
puppet-e826453107fc3888da4667be9cce9cb7661072f8.zip
Merge branch 'master' of git://reductivelabs.com/puppet
Diffstat (limited to 'lib/puppet/rails/host.rb')
-rw-r--r--lib/puppet/rails/host.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/puppet/rails/host.rb b/lib/puppet/rails/host.rb
index ca1e10c93..b7ca4c2e4 100644
--- a/lib/puppet/rails/host.rb
+++ b/lib/puppet/rails/host.rb
@@ -28,7 +28,7 @@ class Puppet::Rails::Host < ActiveRecord::Base
end
# Store our host in the database.
- def self.store(hash)
+ def self.store(node, resources)
unless name = hash[:name]
raise ArgumentError, "You must specify the hostname for storage"
end
@@ -40,23 +40,19 @@ class Puppet::Rails::Host < ActiveRecord::Base
#unless host = find_by_name(name)
seconds = Benchmark.realtime {
unless host = find_by_name(name)
- host = new(:name => name)
+ host = new(:name => node.name)
end
}
Puppet.notice("Searched for host in %0.2f seconds" % seconds) if defined?(Puppet::TIME_DEBUG)
- if ip = hash[:facts]["ipaddress"]
+ if ip = node.parameters["ipaddress"]
host.ip = ip
end
# Store the facts into the database.
- host.setfacts(hash[:facts])
-
- unless hash[:resources]
- raise ArgumentError, "You must pass resources"
- end
+ host.setfacts node.parameters
seconds = Benchmark.realtime {
- host.setresources(hash[:resources])
+ host.setresources(resources)
}
Puppet.notice("Handled resources in %0.2f seconds" % seconds) if defined?(Puppet::TIME_DEBUG)