summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/application/puppetrun.rb5
-rwxr-xr-xspec/unit/application/puppetrun.rb12
2 files changed, 16 insertions, 1 deletions
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