B #3189: Update when flagging trans_start (#4271)

This commit is contained in:
Daniel Clavijo Coca authored and GitHub committed 2020-02-28 18:41:29 +01:00
1 parent de79e7e33b
commit 7ac9331cbe
2 files changed
+13 -9

No files matched your search

+12 -8
View File
@@ -253,18 +253,17 @@ class Container
# Extended reboot required for OpenNebula execution flow
def reboot(force)
case config['user.reboot_state']
when 'STOPPED'
if transient?
start
config['user.reboot_state'] = 'RUNNING'
transition_end # container reached a final state
transition_end # container reached the final state of rebooting
update
else
transition_start # container will be started later
check_stop(force)
config['user.reboot_state'] = 'STOPPED'
end
update
update
check_stop(force)
end
end
def restart(options = {})
@@ -496,6 +495,11 @@ class Container
@lxc['config'].delete('user.one_status')
end
# Helper method for querying transition phase
def transient?
@lxc['config']['user.one_status'] == '0'
end
private
def idmaps_file
+1 -1
View File
@@ -108,7 +108,7 @@ module LXD
# * 'stopped' container not running or in the process of shutting down.
# * 'failure' container have failed.
def get_state(container)
return '-' if container.config['user.one_status'] == '0'
return '-' if container.transient?
begin
status = container.status.downcase