[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:20:44 UTC 2009


The following commit has been merged in the master branch:
commit 5c53617aba31abaa7becd9725155b570fac2a90d
Author: AJ Christensen <aj at junglist.gen.nz>
Date:   Wed Jul 30 11:33:18 2008 +1200

    Added a search method to the YAML indirector.
    
    This performs a glob on the YAML directory, and instances everything it finds

diff --git a/lib/puppet/indirector/yaml.rb b/lib/puppet/indirector/yaml.rb
index 3573ba5..3f05ce6 100644
--- a/lib/puppet/indirector/yaml.rb
+++ b/lib/puppet/indirector/yaml.rb
@@ -34,11 +34,20 @@ class Puppet::Indirector::Yaml < Puppet::Indirector::Terminus
         end
     end
 
+    # Get the yaml directory
+    def base
+      (Puppet[:name] == "puppetmasterd") ? Puppet[:yamldir] : Puppet[:clientyamldir]
+    end
+
     # Return the path to a given node's file.
     def path(name)
-        base = (Puppet[:name] == "puppetmasterd") ? Puppet[:yamldir] : Puppet[:clientyamldir]
         File.join(base, self.class.indirection_name.to_s, name.to_s + ".yaml")
     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) }
+    end
 
     private
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list