[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Nick Lewis nick at puppetlabs.com
Tue May 10 08:06:54 UTC 2011


The following commit has been merged in the experimental branch:
commit 50ba62d68ef3a6a81e00581dd7d74f6387bd73fc
Author: Nick Lewis <nick at puppetlabs.com>
Date:   Tue Mar 22 14:29:52 2011 -0700

    maint: Make args to Catalog.select explicit
    
    No other args are used, so passing *args and shifting is unnecessary.

diff --git a/README.markdown b/README.markdown
index dd9dd58..656a3fb 100644
--- a/README.markdown
+++ b/README.markdown
@@ -96,12 +96,14 @@ Like most parts of Puppet, these are easy to extend.  Just drop a new action int
 
     $ cat lib/puppet/interface/catalog/select.rb 
     # Select and show a list of resources of a given type.
-    Puppet::Interface::Catalog.action :select do |*args|
-      host = args.shift
-      type = args.shift
-      catalog = Puppet::Resource::Catalog.indirection.find(host)
-
-      catalog.resources.reject { |res| res.type != type }.each { |res| puts res }
+    Puppet::Interface.interface(:catalog) do
+      action :select do
+        invoke do |host,type|
+          catalog = Puppet::Resource::Catalog.indirection.find(host)
+
+          catalog.resources.reject { |res| res.type != type }.each { |res| puts res }
+        end
+      end
     end
     $ puppet catalog select localhost Class
     Class[main]
diff --git a/lib/puppet/interface/catalog/select.rb b/lib/puppet/interface/catalog/select.rb
index 3f724d3..32d9b7c 100644
--- a/lib/puppet/interface/catalog/select.rb
+++ b/lib/puppet/interface/catalog/select.rb
@@ -1,9 +1,7 @@
 # Select and show a list of resources of a given type.
 Puppet::Interface.interface(:catalog) do
   action :select do
-    invoke do |*args|
-      host = args.shift
-      type = args.shift
+    invoke do |host,type|
       catalog = Puppet::Resource::Catalog.indirection.find(host)
 
       catalog.resources.reject { |res| res.type != type }.each { |res| puts res }

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list