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,
|
||||
client_plugin.ClientPlugin):
|
||||
|
||||
deferred_server_statuses = ['BUILD',
|
||||
deferred_server_statuses = {'BUILD',
|
||||
'HARD_REBOOT',
|
||||
'PASSWORD',
|
||||
'REBOOT',
|
||||
@ -56,7 +56,7 @@ class NovaClientPlugin(microversion_mixin.MicroversionMixin,
|
||||
'REVERT_RESIZE',
|
||||
'SHUTOFF',
|
||||
'SUSPENDED',
|
||||
'VERIFY_RESIZE']
|
||||
'VERIFY_RESIZE'}
|
||||
|
||||
exceptions_module = exceptions
|
||||
|
||||
|
@ -865,7 +865,7 @@ class Instance(resource.Resource, sh.SchedulerHintsMixin):
|
||||
status = cp.get_status(server)
|
||||
LOG.debug('%(name)s check_suspend_complete status = %(status)s',
|
||||
{'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'
|
||||
else:
|
||||
exc = exception.ResourceUnknownStatus(
|
||||
|
@ -1708,7 +1708,7 @@ class Server(server_base.BaseServer, sh.SchedulerHintsMixin,
|
||||
status = cp.get_status(server)
|
||||
LOG.debug('%(name)s check_suspend_complete status = %(status)s',
|
||||
{'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'
|
||||
else:
|
||||
exc = exception.ResourceUnknownStatus(
|
||||
|
Loading…
Reference in New Issue
Block a user