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

Luke Kanies luke at puppetlabs.com
Wed Jul 14 10:32:29 UTC 2010


The following commit has been merged in the upstream branch:
commit da00f682ce0d1778183f9cf7dbe6d2e133b11841
Author: Luke Kanies <luke at puppetlabs.com>
Date:   Tue Apr 13 08:51:17 2010 -0700

    Making a Puppet::Module test more resilient
    
    It would fail if a directory unexpectedly existed.
    
    Signed-off-by: Luke Kanies <luke at puppetlabs.com>

diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb
index f30b862..e598a8e 100644
--- a/lib/puppet/module.rb
+++ b/lib/puppet/module.rb
@@ -126,10 +126,10 @@ class Puppet::Module
         return find_init_manifest unless rest # Use init.pp
 
         rest ||= "init.pp"
-        p = File::join(path, MANIFESTS, rest)
-        result = Dir.glob(p).reject { |f| FileTest.directory?(f) }
+        full_path = File::join(path, MANIFESTS, rest)
+        result = Dir.glob(full_path).reject { |f| FileTest.directory?(f) }
         if result.size == 0 and rest !~ /\.pp$/
-            result = Dir.glob(p + ".pp")
+            result = Dir.glob(full_path + ".pp")
         end
         result.flatten.compact
     end
diff --git a/spec/unit/module.rb b/spec/unit/module.rb
index e6623be..85cc841 100755
--- a/spec/unit/module.rb
+++ b/spec/unit/module.rb
@@ -405,6 +405,7 @@ describe Puppet::Module, "when finding matching manifests" do
 
     it "should return all manifests matching the glob pattern" do
         Dir.expects(:glob).with("/a/manifests/yay/*.pp").returns(%w{foo bar})
+        FileTest.stubs(:directory?).returns false
 
         @mod.match_manifests("yay/*.pp").should == %w{foo bar}
     end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list