Merge "Use set instead of list of server_deferred_statuses"
This commit is contained in:
commit
3e2209aeb8
@ -47,7 +47,7 @@ CLIENT_NAME = 'nova'
|
|||||||
class NovaClientPlugin(microversion_mixin.MicroversionMixin,
|
class NovaClientPlugin(microversion_mixin.MicroversionMixin,
|
||||||
client_plugin.ClientPlugin):
|
client_plugin.ClientPlugin):
|
||||||
|
|
||||||
deferred_server_statuses = ['BUILD',
|
deferred_server_statuses = {'BUILD',
|
||||||
'HARD_REBOOT',
|
'HARD_REBOOT',
|
||||||
'PASSWORD',
|
'PASSWORD',
|
||||||
'REBOOT',
|
'REBOOT',
|
||||||
@ -56,7 +56,7 @@ class NovaClientPlugin(microversion_mixin.MicroversionMixin,
|
|||||||
'REVERT_RESIZE',
|
'REVERT_RESIZE',
|
||||||
'SHUTOFF',
|
'SHUTOFF',
|
||||||
'SUSPENDED',
|
'SUSPENDED',
|
||||||
'VERIFY_RESIZE']
|
'VERIFY_RESIZE'}
|
||||||
|
|
||||||
exceptions_module = exceptions
|
exceptions_module = exceptions
|
||||||
|
|
||||||
|
@ -865,7 +865,7 @@ class Instance(resource.Resource, sh.SchedulerHintsMixin):
|
|||||||
status = cp.get_status(server)
|
status = cp.get_status(server)
|
||||||
LOG.debug('%(name)s check_suspend_complete status = %(status)s',
|
LOG.debug('%(name)s check_suspend_complete status = %(status)s',
|
||||||
{'name': self.name, 'status': status})
|
{'name': self.name, 'status': status})
|
||||||
if status in list(cp.deferred_server_statuses + ['ACTIVE']):
|
if status in (cp.deferred_server_statuses | {'ACTIVE'}):
|
||||||
return status == 'SUSPENDED'
|
return status == 'SUSPENDED'
|
||||||
else:
|
else:
|
||||||
exc = exception.ResourceUnknownStatus(
|
exc = exception.ResourceUnknownStatus(
|
||||||
|
@ -1708,7 +1708,7 @@ class Server(server_base.BaseServer, sh.SchedulerHintsMixin,
|
|||||||
status = cp.get_status(server)
|
status = cp.get_status(server)
|
||||||
LOG.debug('%(name)s check_suspend_complete status = %(status)s',
|
LOG.debug('%(name)s check_suspend_complete status = %(status)s',
|
||||||
{'name': self.name, 'status': status})
|
{'name': self.name, 'status': status})
|
||||||
if status in list(cp.deferred_server_statuses + ['ACTIVE']):
|
if status in (cp.deferred_server_statuses | {'ACTIVE'}):
|
||||||
return status == 'SUSPENDED'
|
return status == 'SUSPENDED'
|
||||||
else:
|
else:
|
||||||
exc = exception.ResourceUnknownStatus(
|
exc = exception.ResourceUnknownStatus(
|
||||||
|
Loading…
Reference in New Issue
Block a user