summaryrefslogtreecommitdiffstats
path: root/lib/puppet/indirector
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-08-27 12:33:15 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-08-27 12:33:15 -0700
commitfb9034731ddae41f1009745eb8eb1ea53aa05cfb (patch)
tree5cb8296af8859f59b9a20995105af77a9cdb2821 /lib/puppet/indirector
parent16f701edd89a320ad73b5468d883dfb017fe6e96 (diff)
parent8be1929043f4560bb17a4b06293b3f9a4efcfdbf (diff)
downloadpuppet-fb9034731ddae41f1009745eb8eb1ea53aa05cfb.tar.gz
puppet-fb9034731ddae41f1009745eb8eb1ea53aa05cfb.tar.xz
puppet-fb9034731ddae41f1009745eb8eb1ea53aa05cfb.zip
Merge commit '2.6.1rc3' into next
Diffstat (limited to 'lib/puppet/indirector')
-rw-r--r--lib/puppet/indirector/yaml.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/puppet/indirector/yaml.rb b/lib/puppet/indirector/yaml.rb
index c7c053f4b..23997e97a 100644
--- a/lib/puppet/indirector/yaml.rb
+++ b/lib/puppet/indirector/yaml.rb
@@ -41,19 +41,16 @@ class Puppet::Indirector::Yaml < Puppet::Indirector::Terminus
end
end
- # Get the yaml directory
- def base
- Puppet.run_mode.master? ? Puppet[:yamldir] : Puppet[:clientyamldir]
- end
-
# Return the path to a given node's file.
- def path(name)
- File.join(base, self.class.indirection_name.to_s, name.to_s + ".yaml")
+ def path(name,ext='.yaml')
+ base = Puppet.run_mode.master? ? Puppet[:yamldir] : Puppet[:clientyamldir]
+ File.join(base, self.class.indirection_name.to_s, name.to_s + ext)
end
- # Do a glob on the yaml directory, loading each file found
def search(request)
- Dir.glob(File.join(base, self.class.indirection_name.to_s, request.key)).collect { |f| YAML.load_file(f) }
+ Dir.glob(path(request.key,'')).collect do |file|
+ YAML.load_file(file)
+ end
end
private