diff options
Diffstat (limited to 'lib/puppet/node.rb')
-rw-r--r-- | lib/puppet/node.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/puppet/node.rb b/lib/puppet/node.rb index e10299d87..74bf8902d 100644 --- a/lib/puppet/node.rb +++ b/lib/puppet/node.rb @@ -67,10 +67,14 @@ class Puppet::Node # Merge the node facts with parameters from the node source. def fact_merge - if facts = Puppet::Node::Facts.find(name) - merge(facts.values) - else - Puppet.warning "Could not find facts for %s; you probably have a discrepancy between the node and fact names" % name + begin + if facts = Puppet::Node::Facts.find(name) + merge(facts.values) + end + rescue => detail + error = Puppet::Error.new("Could not retrieve facts for %s: %s" % [name, detail]) + error.set_backtrace(detail.backtrace) + raise error end end @@ -79,6 +83,8 @@ class Puppet::Node params.each do |name, value| @parameters[name] = value unless @parameters.include?(name) end + + @parameters["environment"] ||= self.environment if self.environment end # Calculate the list of names we might use for looking |