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:
parent
082fbe477e
commit
ef798f872f
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user