summaryrefslogtreecommitdiffstats
path: root/lib/puppet/indirector
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-07-25 17:02:24 -0700
committerNick Lewis <nick@puppetlabs.com>2011-07-25 17:02:24 -0700
commitb13427b56d8529731d0334d420b24a592ecb43ea (patch)
tree1d2f89907e6136bea2ace8e84a57966779af89d1 /lib/puppet/indirector
parent043c3e87c882d38b9708b6e215425a9935f74769 (diff)
parent8baa4897e777f9515dc1663317f432ace3067bae (diff)
downloadpuppet-b13427b56d8529731d0334d420b24a592ecb43ea.tar.gz
puppet-b13427b56d8529731d0334d420b24a592ecb43ea.tar.xz
puppet-b13427b56d8529731d0334d420b24a592ecb43ea.zip
Merge branch '2.7.x'
Conflicts: lib/puppet/type/file/source.rb spec/unit/resource/catalog_spec.rb
Diffstat (limited to 'lib/puppet/indirector')
-rw-r--r--lib/puppet/indirector/face.rb24
-rw-r--r--lib/puppet/indirector/report/processor.rb2
2 files changed, 19 insertions, 7 deletions
diff --git a/lib/puppet/indirector/face.rb b/lib/puppet/indirector/face.rb
index ead3f4b46..adb6b688b 100644
--- a/lib/puppet/indirector/face.rb
+++ b/lib/puppet/indirector/face.rb
@@ -48,16 +48,26 @@ class Puppet::Indirector::Face < Puppet::Face
return result
end
+ option "--extra HASH" do
+ summary "Extra arguments to pass to the indirection request"
+ description <<-end
+ A terminus can take additional arguments to refine the operation, which
+ are passed as an arbitrary hash to the back-end. Anything passed as
+ the extra value is just send direct to the back-end.
+ end
+ default_to do Hash.new end
+ end
+
action :destroy do
summary "Delete an object."
arguments "<key>"
- when_invoked { |key, options| call_indirection_method(:destroy, key, options) }
+ when_invoked {|key, options| call_indirection_method :destroy, key, options[:extra] }
end
action :find do
summary "Retrieve an object by name."
arguments "<key>"
- when_invoked { |key, options| call_indirection_method(:find, key, options) }
+ when_invoked {|key, options| call_indirection_method :find, key, options[:extra] }
end
action :save do
@@ -68,13 +78,13 @@ class Puppet::Indirector::Face < Puppet::Face
currently accept data from STDIN, save actions cannot currently be invoked
from the command line.
EOT
- when_invoked { |key, options| call_indirection_method(:save, key, options) }
+ when_invoked {|key, options| call_indirection_method :save, key, options[:extra] }
end
action :search do
summary "Search for an object or retrieve multiple objects."
arguments "<query>"
- when_invoked { |key, options| call_indirection_method(:search, key, options) }
+ when_invoked {|key, options| call_indirection_method :search, key, options[:extra] }
end
# Print the configuration for the current terminus class
@@ -86,11 +96,11 @@ class Puppet::Indirector::Face < Puppet::Face
run mode with the '--mode' option.
EOT
- when_invoked do |*args|
+ when_invoked do |options|
if t = indirection.terminus_class
- puts "Run mode '#{Puppet.run_mode.name}': #{t}"
+ "Run mode '#{Puppet.run_mode.name}': #{t}"
else
- $stderr.puts "No default terminus class for run mode '#{Puppet.run_mode.name}'"
+ "No default terminus class for run mode '#{Puppet.run_mode.name}'"
end
end
end
diff --git a/lib/puppet/indirector/report/processor.rb b/lib/puppet/indirector/report/processor.rb
index 88fe4b487..81b379eb8 100644
--- a/lib/puppet/indirector/report/processor.rb
+++ b/lib/puppet/indirector/report/processor.rb
@@ -20,9 +20,11 @@ class Puppet::Transaction::Report::Processor < Puppet::Indirector::Code
# LAK:NOTE This isn't necessarily the best design, but it's backward
# compatible and that's good enough for now.
def process(report)
+ Puppet.debug "Recieved report to process from #{report.host}"
return if Puppet[:reports] == "none"
reports.each do |name|
+ Puppet.debug "Processing report from #{report.host} with processor #{name}"
if mod = Puppet::Reports.report(name)
# We have to use a dup because we're including a module in the
# report.