diff options
Diffstat (limited to 'lib/puppet/application/kick.rb')
-rw-r--r-- | lib/puppet/application/kick.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/puppet/application/kick.rb b/lib/puppet/application/kick.rb index e6cbed6c8..eaafc0935 100644 --- a/lib/puppet/application/kick.rb +++ b/lib/puppet/application/kick.rb @@ -32,7 +32,7 @@ class Puppet::Application::Kick < Puppet::Application begin options[:parallel] = Integer(arg) rescue - $stderr.puts "Could not convert %s to an integer" % arg.inspect + $stderr.puts "Could not convert #{arg.inspect} to an integer" exit(23) end end @@ -80,9 +80,9 @@ class Puppet::Application::Kick < Puppet::Application if $CHILD_STATUS.exitstatus != 0 failures << host end - print "%s finished with exit code %s\n" % [host, $CHILD_STATUS.exitstatus] + print "#{host} finished with exit code #{$CHILD_STATUS.exitstatus}\n" else - $stderr.puts "Could not find host for PID %s with status %s" % [pid, $CHILD_STATUS.exitstatus] + $stderr.puts "Could not find host for PID #{pid} with status #{$CHILD_STATUS.exitstatus}" end rescue Errno::ECHILD # There are no children left, so just exit unless there are still @@ -93,7 +93,7 @@ class Puppet::Application::Kick < Puppet::Application puts "Finished" exit(0) else - puts "Failed: %s" % failures.join(", ") + puts "Failed: #{failures.join(", ")}" exit(3) end end @@ -105,7 +105,7 @@ class Puppet::Application::Kick < Puppet::Application if options[:ping] out = %x{ping -c 1 #{host}} unless $CHILD_STATUS == 0 - $stderr.print "Could not contact %s\n" % host + $stderr.print "Could not contact #{host}\n" next end end @@ -115,7 +115,7 @@ class Puppet::Application::Kick < Puppet::Application port = Puppet[:puppetport] url = ["https://#{host}:#{port}", "production", "run", host].join('/') - print "Triggering %s\n" % host + print "Triggering #{host}\n" begin run_options = { :tags => @tags, @@ -128,7 +128,7 @@ class Puppet::Application::Kick < Puppet::Application puts "status is #{result}" rescue => detail puts detail.backtrace if Puppet[:trace] - $stderr.puts "Host %s failed: %s\n" % [host, detail] + $stderr.puts "Host #{host} failed: #{detail}\n" exit(2) end @@ -136,10 +136,10 @@ class Puppet::Application::Kick < Puppet::Application when "success"; exit(0) when "running" - $stderr.puts "Host %s is already running" % host + $stderr.puts "Host #{host} is already running" exit(3) else - $stderr.puts "Host %s returned unknown answer '%s'" % [host, result] + $stderr.puts "Host #{host} returned unknown answer '#{result}'" exit(12) end end @@ -178,12 +178,12 @@ class Puppet::Application::Kick < Puppet::Application if Puppet[:node_terminus] == "ldap" and (options[:all] or @classes) if options[:all] @hosts = Puppet::Node.search("whatever", :fqdn => options[:fqdn]).collect { |node| node.name } - puts "all: %s" % @hosts.join(", ") + puts "all: #{@hosts.join(", ")}" else @hosts = [] @classes.each do |klass| list = Puppet::Node.search("whatever", :fqdn => options[:fqdn], :class => klass).collect { |node| node.name } - puts "%s: %s" % [klass, list.join(", ")] + puts "#{klass}: #{list.join(", ")}" @hosts += list end |