1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Log everything that comes from stderr(cherry picked from commit ba954f3bb3458d2439b5ea853fb18b8b74de91d7)

This commit is contained in:
Javi Fontan 2011-03-29 17:31:53 +02:00 committed by Ruben S. Montero
parent d57afb1494
commit 5a3408a64b

View File

@ -86,17 +86,17 @@ class GenericCommand
if @code!=0
log("Command execution fail: #{command}")
log("STDERR follows.")
log(@stderr)
end
log(@stderr)
return @code
end
# Parses error message from +stderr+ output
def get_error_message
tmp=@stderr.scan(/^ERROR MESSAGE --8<------\n(.*?)ERROR MESSAGE ------>8--$/m)
return "Error message not available" if !tmp[0]
return "-" if !tmp[0]
tmp[0].join(' ').strip
end
@ -179,14 +179,14 @@ class RemotesCommand < SSHCommand
cmd = self.new(cmd_string, host, logger, stdin)
cmd.run
if cmd.code == MAGIC_RC
cmd.update_remotes(host, remote_dir, logger)
@command = command
cmd.run
end
while cmd.code != 0 and retries != 0
sleep 1
cmd.run