From b83b159b69e1952c20f23629fc1255069ad5abb0 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 27 May 2009 09:57:57 -0500 Subject: Fixing #2243 - puppetrun works again The problem was that some defaults were nil but had to be 'false', because xmlrpc can't serialize 'nil' as an rpc argument. Signed-off-by: Luke Kanies --- lib/puppet/application/puppetrun.rb | 5 ++++- spec/unit/application/puppetrun.rb | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/puppet/application/puppetrun.rb b/lib/puppet/application/puppetrun.rb index 59ace826a..2dbd803fa 100644 --- a/lib/puppet/application/puppetrun.rb +++ b/lib/puppet/application/puppetrun.rb @@ -128,8 +128,9 @@ Puppet::Application.new(:puppetrun) do print "Triggering %s\n" % host begin - result = client.run(@tags, options[:ignoreschedules], options[:foreground]) + result = client.run(@tags, options[:ignoreschedules] || false, options[:foreground] || false) rescue => detail + puts detail.backtrace if Puppet[:trace] $stderr.puts "Host %s failed: %s\n" % [host, detail] exit(2) end @@ -155,6 +156,8 @@ Puppet::Application.new(:puppetrun) do options[:parallel] = 1 options[:verbose] = true options[:fqdn] = true + options[:ignoreschedules] = false + options[:foreground] = false @hosts = [] @classes = [] diff --git a/spec/unit/application/puppetrun.rb b/spec/unit/application/puppetrun.rb index 2a8ccb84a..d44b406e9 100755 --- a/spec/unit/application/puppetrun.rb +++ b/spec/unit/application/puppetrun.rb @@ -57,6 +57,18 @@ describe "puppetrun" do @puppetrun.options[:fqdn].should be_true end + + it "should set ignoreschedules to 'false'" do + @puppetrun.run_preinit + + @puppetrun.options[:ignoreschedules].should be_false + end + + it "should set foreground to 'false'" do + @puppetrun.run_preinit + + @puppetrun.options[:foreground].should be_false + end end describe "when applying options" do -- cgit