lib/ors/helpers.rb in ors-0.2.3 vs lib/ors/helpers.rb in ors-0.2.4
- old
+ new
@@ -77,13 +77,13 @@
yield server
end
end.map {|thread| thread.join }
end
- # options = {:exec => ?, :capture => ?}
+ # options = {:exec => ?, :capture => ?, :quiet_ssh => ?}
def execute_command server, *command_array
- options = {:exec => false, :capture => false}
+ options = {:exec => false, :capture => false, :quiet_ssh => false}
options.merge!(command_array.pop) if command_array.last.is_a?(Hash)
options[:local] = true if server.to_s == "localhost"
command = build_command(server, command_array, options)
@@ -116,17 +116,18 @@
options = {}
end
commands = command_array.join " && "
psuedo_tty = options[:exec] ? '-t ' : ''
+ quiet_ssh = options[:quiet_ssh] ? '-q ' : ''
if options[:local]
commands
else
if use_gateway
- %(ssh #{psuedo_tty}#{gateway} 'ssh #{psuedo_tty}#{deploy_user}@#{server} "#{commands}"')
+ %(ssh #{quiet_ssh}#{psuedo_tty}#{gateway} 'ssh #{quiet_ssh}#{psuedo_tty}#{deploy_user}@#{server} "#{commands}"')
else
- %(ssh #{psuedo_tty}#{deploy_user}@#{server} "#{commands}")
+ %(ssh #{quiet_ssh}#{psuedo_tty}#{deploy_user}@#{server} "#{commands}")
end
end
end
def info message