lib/rbbt/util/cmd.rb in rbbt-util-5.5.1 vs lib/rbbt/util/cmd.rb in rbbt-util-5.5.2
- old
+ new
@@ -27,14 +27,14 @@
begin
Process.waitpid(@pid)
rescue
end
- Log.debug "Process #{ cmd } succeded" if $? and $?.success? and log
+ Log.debug{"Process #{ cmd } succeded" if $? and $?.success? and log}
if $? and not $?.success?
- Log.debug "Raising exception" if log
+ Log.debug{"Raising exception" if log}
exception = CMDError.new "Command [#{@pid}] #{@cmd} failed with error status #{$?.exitstatus}"
original_close
raise exception
end
end
@@ -50,11 +50,11 @@
original_close unless self.closed?
end
def force_close
if @pid
- Log.debug "Forcing close by killing '#{@pid}'" if log
+ Log.debug{"Forcing close by killing '#{@pid}'" if log}
begin
Process.kill("KILL", @pid)
Process.waitpid(@pid)
rescue
Log.low "Exception in forcing close of command [#{ @pid }, #{cmd}]: #{$!.message}"
@@ -156,12 +156,12 @@
exec(cmd)
exit(-1)
rescue Exception
- Log.debug("CMDError: #{$!.message}") if log
- Log.debug("Backtrace: \n" + $!.backtrace * "\n") if log
+ Log.debug{ "CMDError: #{$!.message}" } if log
+ Log.debug{ "Backtrace: \n" + $!.backtrace * "\n" } if log
raise CMDError, $!.message
end
}
sin.first.close
@@ -171,10 +171,10 @@
sin = sin.last
sout = sout.first
serr = serr.first
- Log.debug "CMD: [#{pid}] #{cmd}" if log
+ Log.debug{"CMD: [#{pid}] #{cmd}" if log}
if in_content.respond_to?(:read)
Thread.new do
begin
loop do