diff options
author | Thom May <thom@virelais.nyc.joostas.com> | 2008-11-26 14:58:27 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-11-29 09:41:51 +1100 |
commit | 3c4efa7ec2043043d72d325e67fe5bd6098e0413 (patch) | |
tree | 7e8fcff95678231c3f07a8d6b7df8c326979109a | |
parent | 3a395095d7b913661484bc5caeeb90cb34cd5b3f (diff) | |
download | puppet-3c4efa7ec2043043d72d325e67fe5bd6098e0413.tar.gz puppet-3c4efa7ec2043043d72d325e67fe5bd6098e0413.tar.xz puppet-3c4efa7ec2043043d72d325e67fe5bd6098e0413.zip |
Fixes #1773 - no longer check for absolute paths
-rw-r--r-- | lib/puppet/module.rb | 2 | ||||
-rwxr-xr-x | spec/unit/module.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb index 9385812b1..7bf35ac18 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 a6608fc1b..1deaec232 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) |