Permalink
Browse files

Merge branch 'maint/master/make-catalog-select-args-explicit'

  • Loading branch information...
2 parents 0af36f4 + 50ba62d commit 379ae0733b2850991a2bff2d5b253cab93b52356 @nicklewis nicklewis committed Mar 22, 2011
Showing with 9 additions and 9 deletions.
  1. +8 −6 README.markdown
  2. +1 −3 lib/puppet/interface/catalog/select.rb
View
@@ -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]
@@ -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 }

0 comments on commit 379ae07

Please sign in to comment.