lib/pec2/pssh.rb in pec2-0.5.0 vs lib/pec2/pssh.rb in pec2-0.5.1
- old
+ new
@@ -3,11 +3,11 @@
module Pec2
class Pssh
PSSH_PATH = File.expand_path('../../../exe/bin/pssh', __FILE__)
- def initialize(options, hosts_file)
+ def initialize(options, hosts_file, parallel = 1)
@pssh_command = "#{PSSH_PATH} -t 0 -x '-tt' -h #{hosts_file} -O StrictHostKeyChecking=no"
if options[:print]
@pssh_command = "#{@pssh_command} -P"
end
@@ -17,12 +17,10 @@
if options[:log]
@pssh_command = "#{@pssh_command} -o #{options[:log]}"
end
- if options[:parallel]
- @pssh_command = "#{@pssh_command} -p #{options[:parallel]}"
- end
+ @pssh_command = "#{@pssh_command} -p #{options[:parallel] || parallel}"
@sudo_password = options[:sudo_password]
end
def build_pssh_command(command)
if @sudo_password