[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:30:47 UTC 2010


The following commit has been merged in the upstream branch:
commit a4b77f61f26b20a48e0e55f8fc8bfef338878e6e
Author: Luke Kanies <luke at madstop.com>
Date:   Wed Nov 4 17:22:13 2009 -0500

    Failing in app/puppet if facts are not found
    
    This is a rare case in puppet, but at least will
    come up when we support routes.
    
    Signed-off-by: Luke Kanies <luke at madstop.com>

diff --git a/lib/puppet/application/main.rb b/lib/puppet/application/main.rb
index faa3176..5eab81a 100644
--- a/lib/puppet/application/main.rb
+++ b/lib/puppet/application/main.rb
@@ -89,7 +89,9 @@ Puppet::Application.new(:main) do
         end
 
         # Collect our facts.
-        facts = Puppet::Node::Facts.find(Puppet[:certname])
+        unless facts = Puppet::Node::Facts.find(Puppet[:certname])
+            raise "Could not find facts for %s" % Puppet[:certname]
+        end
 
         # Find our Node
         unless node = Puppet::Node.find(Puppet[:certname])
diff --git a/spec/unit/application/main.rb b/spec/unit/application/main.rb
index a5ebc63..497ee6b 100755
--- a/spec/unit/application/main.rb
+++ b/spec/unit/application/main.rb
@@ -229,6 +229,12 @@ describe "Puppet" do
                 @main.main
             end
 
+            it "should raise an error if we can't find the node" do
+                Puppet::Node::Facts.expects(:find).returns(nil)
+
+                lambda { @puppet.main }.should raise_error
+            end
+
             it "should find the node" do
                 Puppet::Node.expects(:find).returns(@node)
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list