[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

Luke Kanies luke at madstop.com
Fri Jan 23 14:21:14 UTC 2009


The following commit has been merged in the master branch:
commit 6bcfd9f021be13bfd3269eaa72bc289eab37a64f
Author: Luke Kanies <luke at madstop.com>
Date:   Fri Oct 3 13:11:44 2008 -0500

    Fixing #947 - pluginsync no longer fails poorly when no plugins exist
    
    Note that it still fails -- it's just a more reasonable failure.
    
    Signed-off-by: Luke Kanies <luke at madstop.com>

diff --git a/CHANGELOG b/CHANGELOG
index bc52d08..928ac8e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
 0.24.x
+    Fixing #947 - pluginsync no longer fails poorly when no plugins exist
+
     Fixing #1614 - Environments no longer have to be listed out
 
     Fixed #1628 - Changed node search to use certname rather than Facter hostname
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb
index ff9b96f..da0a2be 100755
--- a/lib/puppet/network/handler/fileserver.rb
+++ b/lib/puppet/network/handler/fileserver.rb
@@ -70,7 +70,9 @@ class Puppet::Network::Handler
             mount.debug("Describing %s for %s" % [url, client]) if client
 
             # use the mount to resolve the path for us.
-            metadata = Puppet::FileServing::Metadata.new(url, :path => mount.file_path(path, client), :links => links)
+            return "" unless full_path = mount.file_path(path, client)
+
+            metadata = Puppet::FileServing::Metadata.new(url, :path => full_path, :links => links)
 
             return "" unless metadata.exist?
 
@@ -710,7 +712,7 @@ class Puppet::Network::Handler
             end
             
             def file_path(relpath, client = nil)
-                mod = valid_modules.map { |m| mod_path_exists?(m, relpath, client) ? m : nil }.compact.first
+                return nil unless mod = valid_modules.map { |m| mod_path_exists?(m, relpath, client) ? m : nil }.compact.first
                 mod_file_path(mod, relpath, client)
             end
 
diff --git a/spec/unit/network/handler/fileserver.rb b/spec/unit/network/handler/fileserver.rb
index a9138f6..e548cba 100644
--- a/spec/unit/network/handler/fileserver.rb
+++ b/spec/unit/network/handler/fileserver.rb
@@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
 require 'puppet/network/handler/fileserver'
 
 
-describe Puppet::Network::Handler do
+describe Puppet::Network::Handler::FileServer do
     require 'tmpdir'
 
     def create_file(filename)
@@ -130,4 +130,4 @@ describe Puppet::Network::Handler do
         FileUtils.rm_rf(@basedir)
     end
 
-end
\ No newline at end of file
+end
diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb
index a705dbf..873657e 100755
--- a/test/network/handler/fileserver.rb
+++ b/test/network/handler/fileserver.rb
@@ -437,6 +437,14 @@ class TestFileServer < Test::Unit::TestCase
         assert_nil(retval, "Description of non-existent mounts returned a value")
     end
 
+    def test_describe_does_not_fail_when_mount_does_not_find_file
+        server = Puppet::Network::Handler.fileserver.new(:Local => true, :Config => false)
+
+        assert_nothing_raised("Failed when describing missing plugins") do
+            server.describe "/plugins"
+        end
+    end
+
     # test that our config file is parsing and working as planned
     def test_configfile
         server = nil

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list