1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-26 10:03:37 +03:00

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

(cherry picked from commit 7ac9331cbe5bb086f9198b21ddb951aa4f562087)
This commit is contained in:
Daniel Clavijo Coca 2020-02-28 11:41:29 -06:00 committed by Ruben S. Montero
parent 1c50062b11
commit 90c3bbe93e
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 13 additions and 9 deletions

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

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