lib/cloudkick/commands/parallel.rb in cloudkick-0.2.8 vs lib/cloudkick/commands/parallel.rb in cloudkick-0.2.9
- old
+ new
@@ -1,11 +1,11 @@
require 'tempfile'
module Cloudkick::Command
class Pssh < Base
def index
- unless args.size == 6 or args.size == 8
+ unless args.size == 4 or args.size == 6
raise CommandFailed, 'usage: cloudkick pssh --query <query> ' \
'--username <username> ' \
'--command <command>'
end
@@ -25,10 +25,14 @@
end
end
file.flush
begin
- system("pssh -i -h #{file.path} -l #{username} '#{command}'")
+ if username
+ system("pssh -i -h #{file.path} -l #{username} '#{command}'")
+ else
+ system("pssh -i -h #{file.path} '#{command}'")
+ end
rescue
raise CommandFailed, 'cloudkick: command not found: pssh'
end
file.close
end