mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
1 parent
de79e7e33b
commit
7ac9331cbe
2 files changed
+13
-9
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user