diff options
-rw-r--r-- | lib/puppet/application/kick.rb | 12 | ||||
-rwxr-xr-x | sbin/puppetrun | 4 | ||||
-rwxr-xr-x | spec/unit/application/kick_spec.rb | 4 |
3 files changed, 12 insertions, 8 deletions
diff --git a/lib/puppet/application/kick.rb b/lib/puppet/application/kick.rb index 0dd4d39ad..3d0d10174 100644 --- a/lib/puppet/application/kick.rb +++ b/lib/puppet/application/kick.rb @@ -38,6 +38,7 @@ class Puppet::Application::Kick < Puppet::Application end def run_command + @hosts += command_line.args options[:test] ? test : main end @@ -143,6 +144,13 @@ class Puppet::Application::Kick < Puppet::Application exit(12) end end + + def initialize + super + @hosts = [] + @classes = [] + @tags = [] + end def preinit [:INT, :TERM].each do |signal| @@ -156,10 +164,6 @@ class Puppet::Application::Kick < Puppet::Application options[:fqdn] = true options[:ignoreschedules] = false options[:foreground] = false - - @hosts = [] - @classes = [] - @tags = [] end def setup diff --git a/sbin/puppetrun b/sbin/puppetrun index d2a1284c9..169513df3 100755 --- a/sbin/puppetrun +++ b/sbin/puppetrun @@ -9,7 +9,7 @@ # # puppet kick [-a|--all] [-c|--class <class>] [-d|--debug] [-f|--foreground] # [-h|--help] [--host <host>] [--no-fqdn] [--ignoreschedules] -# [-t|--tag <tag>] [--test] [-p|--ping] +# [-t|--tag <tag>] [--test] [-p|--ping] <host> [<host> [...]] # # = Description # @@ -114,7 +114,7 @@ # # = Example # -# sudo puppet kick -p 10 --host host1 --host host2 -t remotefile -t webserver +# sudo puppet kick -p 10 -t remotefile -t webserver host1 host2 # # = Author # diff --git a/spec/unit/application/kick_spec.rb b/spec/unit/application/kick_spec.rb index 58e71b2a4..40bc097d3 100755 --- a/spec/unit/application/kick_spec.rb +++ b/spec/unit/application/kick_spec.rb @@ -2,7 +2,6 @@ require File.dirname(__FILE__) + '/../../spec_helper' -require 'puppet/util/ldap/connection' require 'puppet/application/kick' describe Puppet::Application::Kick do @@ -10,6 +9,7 @@ describe Puppet::Application::Kick do confine "Kick's eventloops can only start on POSIX" => Puppet.features.posix? before :each do + require 'puppet/util/ldap/connection' Puppet::Util::Ldap::Connection.stubs(:new).returns(stub_everything) @kick = Puppet::Application[:kick] Puppet::Util::Log.stubs(:newdestination) @@ -230,7 +230,7 @@ describe Puppet::Application::Kick do @kick.stubs(:print) @kick.stubs(:exit) @kick.preinit - @kick.parse_options + @kick.stubs(:parse_options) @kick.setup $stderr.stubs(:puts) end |