lib/rundock/backend.rb in rundock-0.5.4 vs lib/rundock/backend.rb in rundock-0.5.7
- old
+ new
@@ -63,12 +63,12 @@
exit_status = result.exit_status
Logger.formatter.indent do
Logger.debug("cwd: #{exec_options[:cwd]}") if exec_options[:cwd]
Logger.debug("sudo: #{exec_options[:sudo]}") if exec_options[:sudo]
- Logger.error("#{result.stderr.strip}") unless result.stderr.strip.blank?
- Logger.info("#{result.stdout.strip}") unless result.stdout.strip.blank?
+ Logger.error(result.stderr.strip) unless result.stderr.strip.blank?
+ Logger.info(result.stdout.strip) unless result.stdout.strip.blank?
Logger.debug("errexit: #{exec_options[:errexit]}")
Logger.debug("exit status: #{exit_status}")
end
if exec_options[:errexit] && exit_status != 0
@@ -109,14 +109,14 @@
class Ssh < Base
private
def parse(options)
- if options[:ssh_config] && FileTest.exists?(options[:ssh_config])
- ssh_opts = Net::SSH::Config.for(options[:host], [options[:ssh_config]])
- else
- ssh_opts = Net::SSH::Config.for(options[:host])
- end
+ ssh_opts = if options[:ssh_config] && FileTest.exists?(options[:ssh_config])
+ Net::SSH::Config.for(options[:host], [options[:ssh_config]])
+ else
+ Net::SSH::Config.for(options[:host])
+ end
# priority = node_attributes > cli options
ssh_opts[:host_name] = options[:host]
ssh_opts[:keys] = Array(options[:key]) if options[:key]
ssh_opts[:password] = parse_password_from_stdin if options[:ask_password]