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

F #3099 Show container log when action fails

(cherry picked from commit 43e42127487a9b40d74bbd69f0a821bf4886a648)
This commit is contained in:
Daniel Clavijo Coca 2019-03-25 08:41:26 -06:00 committed by Ruben S. Montero
parent 082fbe477e
commit ef798f872f
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -166,6 +166,17 @@ class Container
Command.execute(cmd, true)
end
def show_log
cmd = "#{@lxc_command} info --show-log #{@lxc['name']}"
rc, o, e = Command.execute(cmd, false)
if rc.zero?
OpenNebula.log o
else
OpenNebula.log_error e
end
end
#---------------------------------------------------------------------------
# Contianer Status Control
#---------------------------------------------------------------------------
@ -406,6 +417,9 @@ class Container
# Waits or no for response depending on wait value
def wait?(response, wait, timeout)
@client.wait(response, timeout) unless wait == false
rescue LXDError => e
show_log
raise e
end
# Performs an action on the container that changes the execution status.