summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/node.rb')
-rw-r--r--lib/puppet/node.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/puppet/node.rb b/lib/puppet/node.rb
index 9c5d2d397..7ad7bc3b3 100644
--- a/lib/puppet/node.rb
+++ b/lib/puppet/node.rb
@@ -1,8 +1,11 @@
+require 'puppet/indirector'
+
# A simplistic class for managing the node information itself.
class Puppet::Node
+ require 'puppet/node/facts'
+
# Set up indirection, so that nodes can be looked for in
# the node sources.
- require 'puppet/indirector'
extend Puppet::Indirector
# Use the node source as the indirection terminus.
@@ -66,9 +69,15 @@ class Puppet::Node
end
# Merge the node facts with parameters from the node source.
- # This is only called if the node source has 'fact_merge' set to true.
- def fact_merge(facts)
- facts.each do |name, value|
+ def fact_merge
+ if facts = Puppet::Node::Facts.get(name)
+ merge(facts.values)
+ end
+ end
+
+ # Merge any random parameters into our parameter list.
+ def merge(params)
+ params.each do |name, value|
@parameters[name] = value unless @parameters.include?(name)
end
end