lib/rundock/backend.rb in rundock-0.2.8 vs lib/rundock/backend.rb in rundock-0.2.9

- old
+ new

@@ -39,14 +39,16 @@ command = "cd #{Shellwords.escape(exec_options[:cwd])} && #{command}" if exec_options[:cwd] command = "sudo -H -u #{Shellwords.escape(user)} -- /bin/sh -c #{command}" if exec_options[:user] Logger.debug(%(Start executing: "#{command}")) + return nil if options[:dry_run] + result = @backend.run_command(command) exit_status = result.exit_status Logger.formatter.indent do - Logger.error("#{result.stderr}") unless result.stderr.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