1
0
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:
Daniel Clavijo Coca 2023-06-20 05:33:09 -06:00 committed by Tino Vázquez
parent 99d6d46913
commit e3f1f4b260
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -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