fix pep8 issue on powervc driver

Fix some pep8 issue introduced in recent code change

Closes-Bug: #1393663
Change-Id: I6f18600d000725122f6c6cc4f27ca0b37c2037f4
This commit is contained in:
Terry Yao 2014-11-18 14:12:02 +08:00
parent 3fbb8abd9a
commit 5a255d5d95
3 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,7 @@ class BlockMigrationException(exception.NovaException):
message = _("PowerVC does not support block migration.") message = _("PowerVC does not support block migration.")
super(BlockMigrationException, self).__init__(message=message) super(BlockMigrationException, self).__init__(message=message)
class LiveMigrationException(exception.NovaException): class LiveMigrationException(exception.NovaException):
"""User attempted to perform live migration with block migration.""" """User attempted to perform live migration with block migration."""
def __init__(self, uuid): def __init__(self, uuid):

View File

@ -52,6 +52,7 @@ CONF = cfg.CONF
# store the deleted powervc instance uuids # store the deleted powervc instance uuids
deleted_pvc_ids = set() deleted_pvc_ids = set()
class PowerVCCloudManager(manager.Manager): class PowerVCCloudManager(manager.Manager):
def __init__(self, compute_driver=None, *args, **kwargs): def __init__(self, compute_driver=None, *args, **kwargs):

View File

@ -1206,12 +1206,12 @@ class PowerVCService(object):
current_host != orig_host): current_host != orig_host):
LOG.info(_("Instance %s completed migration.") % pvc_server.id) LOG.info(_("Instance %s completed migration.") % pvc_server.id)
raise loopingcall.LoopingCallDone(True) raise loopingcall.LoopingCallDone(True)
if ((pvc_server.status == pvc_vm_states.ACTIVE or if pvc_task_state is None and current_host == orig_host and\
pvc_server.status == pvc_vm_states.ERROR) and pvc_server.status in (pvc_vm_states.ACTIVE,
pvc_task_state == None and current_host == orig_host): pvc_vm_states.ERROR):
LOG.error('Instance %s failed to migrate to another host, ' LOG.error('Instance %s failed to migrate to another host, '
'please check with PowerVC console error message or ' 'please check with PowerVC console error message or '
'log file',pvc_server.id) 'log file', pvc_server.id)
raise LiveMigrationException(pvc_server.id) raise LiveMigrationException(pvc_server.id)
timer = loopingcall.FixedIntervalLoopingCall(_wait_for_live_migration) timer = loopingcall.FixedIntervalLoopingCall(_wait_for_live_migration)