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

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:21:47 UTC 2009


The following commit has been merged in the master branch:
commit 3c4efa7ec2043043d72d325e67fe5bd6098e0413
Author: Thom May <thom at virelais.nyc.joostas.com>
Date:   Wed Nov 26 14:58:27 2008 -0500

    Fixes #1773 - no longer check for absolute paths

diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb
index 9385812..7bf35ac 100644
--- a/lib/puppet/module.rb
+++ b/lib/puppet/module.rb
@@ -24,7 +24,7 @@ class Puppet::Module
     def self.templatepath(environment = nil)
         dirs = Puppet.settings.value(:templatedir, environment).split(":")
         dirs.select do |p|
-            p =~ /^#{File::SEPARATOR}/ && File::directory?(p)
+            File::directory?(p)
         end
     end
 
diff --git a/spec/unit/module.rb b/spec/unit/module.rb
index a6608fc..1deaec2 100755
--- a/spec/unit/module.rb
+++ b/spec/unit/module.rb
@@ -114,6 +114,12 @@ describe Puppet::Module, " when searching for templates" do
         Puppet::Module.find_template("mytemplate").should == "/my/templates/mytemplate"
     end
 
+    it "should accept relative templatedirs" do
+        Puppet[:templatedir] = "my/templates"
+        File.expects(:directory?).with(File.join(Dir.getwd,"my/templates")).returns(true)
+        Puppet::Module.find_template("mytemplate").should == File.join(Dir.getwd,"my/templates/mytemplate")
+    end
+
     it "should use the environment templatedir if no module is found and an environment is specified" do
         Puppet::Module.stubs(:templatepath).with("myenv").returns(["/myenv/templates"])
         Puppet::Module.expects(:find).with("mymod", "myenv").returns(nil)

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list