lib/conveyor/workers/syntax.rb in gina-conveyor-1.0.0 vs lib/conveyor/workers/syntax.rb in gina-conveyor-1.0.1
- old
+ new
@@ -62,11 +62,11 @@
opts = params.extract_options!
command = Array.wrap(params).join(' ')
info command unless opts[:quiet]
begin
- cmdrunner = Mixlib::ShellOut.new(command, timeout: Conveyor::Foreman.instance.config[:command_timeout] || 600)
+ cmdrunner = Mixlib::ShellOut.new(command, timeout: opts[:timeout] || Conveyor::Foreman.instance.config[:command_timeout] || 600)
cmdrunner.run_command()
info cmdrunner.stdout.chomp unless cmdrunner.stdout.chomp.length == 0
if cmdrunner.error!
@@ -79,13 +79,15 @@
end
end
return !cmdrunner.error!
rescue Mixlib::ShellOut::CommandTimeout => e
- error e.class, "Timeout running: #{command}"
+ error e.class, e.message, "Command: #{command}"
+ # raise e unless opts[:ignore_error]
rescue => e
error e.class, e.message, e.backtrace.join("\n")
+ # raise e unless opts[:ignore_error]
end
end
# Deletes passed in files
def delete(files)
@@ -124,11 +126,11 @@
end
end
# Scp files to destination
# See: man scp
- def scp(src, dest)
- run "scp #{Array.wrap(src).join(' ')} #{dest}"
+ def scp(src, dest, *opts)
+ run "scp #{Array.wrap(src).join(' ')} #{dest}", *opts
end
end
end
end