mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +03:00
F OpenNebula/one#5906: log command output when failure (#2640)
(cherry picked from commit f8f736b082
)
This commit is contained in:
parent
99d6d46913
commit
e3f1f4b260
@ -92,12 +92,20 @@ class HostSyncManager
|
||||
end
|
||||
|
||||
cmd = SSHCommand.run(mkdir_cmd, hostname, logger)
|
||||
return cmd.code if cmd.code != 0
|
||||
return cmd.code if error?(cmd)
|
||||
|
||||
cmd = LocalCommand.run(sync_cmd, logger)
|
||||
return cmd.code if cmd.code != 0
|
||||
return cmd.code if error?(cmd)
|
||||
|
||||
0
|
||||
end
|
||||
|
||||
def error?(cmd)
|
||||
return false if cmd.code == 0
|
||||
|
||||
STDERR.puts cmd.stderr
|
||||
STDOUT.puts cmd.stdout
|
||||
true
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user