mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-26 10:03:37 +03:00
(cherry picked from commit 7ac9331cbe5bb086f9198b21ddb951aa4f562087)
This commit is contained in:
parent
1c50062b11
commit
90c3bbe93e
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user