summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-02-13 21:36:39 -0600
committerJames Turnbull <james@lovedthanlost.net>2009-02-14 22:42:51 +1100
commit610c838146c03921455a15a7a93148748ff909a6 (patch)
tree9e3623153f7f5957e3506247427d681776d5184e /lib/puppet
parenta2eca6c8a1c69244426b077c5775a1cdbdae2d57 (diff)
downloadpuppet-610c838146c03921455a15a7a93148748ff909a6.tar.gz
puppet-610c838146c03921455a15a7a93148748ff909a6.tar.xz
puppet-610c838146c03921455a15a7a93148748ff909a6.zip
Fixing #1527 - Failing Facter does not hurt Puppet
At this point, the server's behaviour is a bit undefined if it tries to compile the catalog with no facts locally. The next commits will fix that. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/configurer/fact_handler.rb7
-rw-r--r--lib/puppet/indirector/catalog/compiler.rb8
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/puppet/configurer/fact_handler.rb b/lib/puppet/configurer/fact_handler.rb
index d0e890f62..8a6de5e9f 100644
--- a/lib/puppet/configurer/fact_handler.rb
+++ b/lib/puppet/configurer/fact_handler.rb
@@ -18,7 +18,12 @@ module Puppet::Configurer::FactHandler
# This works because puppetd configures Facts to use 'facter' for
# finding facts and the 'rest' terminus for caching them. Thus, we'll
# compile them and then "cache" them on the server.
- Puppet::Node::Facts.find(Puppet[:certname])
+ begin
+ Puppet::Node::Facts.find(Puppet[:certname])
+ rescue => detail
+ puts detail.backtrace if Puppet[:trace]
+ Puppet.err("Could not retrieve local facts: %s" % detail)
+ end
end
# Retrieve facts from the central server.
diff --git a/lib/puppet/indirector/catalog/compiler.rb b/lib/puppet/indirector/catalog/compiler.rb
index 83b636433..47635d88c 100644
--- a/lib/puppet/indirector/catalog/compiler.rb
+++ b/lib/puppet/indirector/catalog/compiler.rb
@@ -88,7 +88,13 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
# Turn our host name into a node object.
def find_node(name)
- return nil unless node = Puppet::Node.find(name)
+ begin
+ return nil unless node = Puppet::Node.find(name)
+ rescue => detail
+ puts detail.backtrace if Puppet[:trace]
+ raise Puppet::Error, "Failed when searching for node %s: %s" % [name, detail]
+ end
+
# Add any external data to the node.
add_node_data(node)