Fix powervc driver according to community code change
This defect is to fix for powervc driver according to community code change. Change-Id: If0c069cf53f9718e48a4b2f24a97380281a15422 Closes-Bug: #1431173
This commit is contained in:
@@ -46,7 +46,7 @@ if __name__ == '__main__':
|
|||||||
try:
|
try:
|
||||||
# Obtain glance opts from glance-api.conf
|
# Obtain glance opts from glance-api.conf
|
||||||
glance_config.parse_config(sys.argv, 'glance', 'glance-api')
|
glance_config.parse_config(sys.argv, 'glance', 'glance-api')
|
||||||
log.setup('powervc')
|
log.setup(CONF, 'powervc')
|
||||||
LOG.info(_('Launching PowerVC Driver ImageManager service...'))
|
LOG.info(_('Launching PowerVC Driver ImageManager service...'))
|
||||||
manager = importutils.import_object(
|
manager = importutils.import_object(
|
||||||
'powervc.glance.manager.manager.PowerVCImageManager')
|
'powervc.glance.manager.manager.PowerVCImageManager')
|
||||||
|
|||||||
@@ -676,7 +676,8 @@ class PowerVCCloudManager(manager.Manager):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# Get the uuid of pvc from the local instance.
|
# Get the uuid of pvc from the local instance.
|
||||||
metadata = self.compute_api.get_instance_metadata(ctx, local_instance)
|
inst = instance_obj.Instance.get_by_uuid(ctx, local_instance['uuid'])
|
||||||
|
metadata = self.compute_api.get_instance_metadata(ctx, inst)
|
||||||
return (constants.PVC_ID in metadata)
|
return (constants.PVC_ID in metadata)
|
||||||
|
|
||||||
def _is_valid_pvc_instance(self, ctx, local_instance, pvc_instances):
|
def _is_valid_pvc_instance(self, ctx, local_instance, pvc_instances):
|
||||||
@@ -686,7 +687,8 @@ class PowerVCCloudManager(manager.Manager):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# Get the uuid of pvc from the local instance.
|
# Get the uuid of pvc from the local instance.
|
||||||
metadata = self.compute_api.get_instance_metadata(ctx, local_instance)
|
inst = instance_obj.Instance.get_by_uuid(ctx, local_instance['uuid'])
|
||||||
|
metadata = self.compute_api.get_instance_metadata(ctx, inst)
|
||||||
if constants.PVC_ID not in metadata:
|
if constants.PVC_ID not in metadata:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -1380,7 +1382,9 @@ class PowerVCCloudManager(manager.Manager):
|
|||||||
event_type, updated_instance, **states)
|
event_type, updated_instance, **states)
|
||||||
|
|
||||||
# Call the compute API to update the local instance
|
# Call the compute API to update the local instance
|
||||||
instance_ref = self.compute_api.update(context, local_instance,
|
inst = instance_obj.Instance.get_by_uuid(context,
|
||||||
|
local_instance['uuid'])
|
||||||
|
instance_ref = self.compute_api.update(context, inst,
|
||||||
**updated_instance)
|
**updated_instance)
|
||||||
LOG.debug('update state for local db instance: %s with '
|
LOG.debug('update state for local db instance: %s with '
|
||||||
'data: %s' % (local_instance, updated_instance))
|
'data: %s' % (local_instance, updated_instance))
|
||||||
@@ -1992,11 +1996,18 @@ class PowerVCCloudManager(manager.Manager):
|
|||||||
port_ids = []
|
port_ids = []
|
||||||
for port in ports:
|
for port in ports:
|
||||||
port_ids.append(port.get('id'))
|
port_ids.append(port.get('id'))
|
||||||
nw_info = self.network_api.get_instance_nw_info(context,
|
inst = instance_obj.Instance.get_by_uuid(context,
|
||||||
instance,
|
instance['uuid'])
|
||||||
nets,
|
try:
|
||||||
port_ids)
|
nw_info = \
|
||||||
LOG.info("_fix_instance_nw_info" + str(nw_info))
|
self.network_api.get_instance_nw_info(context,
|
||||||
|
inst,
|
||||||
|
nets,
|
||||||
|
port_ids)
|
||||||
|
LOG.info("_fix_instance_nw_info suc:" + str(nw_info))
|
||||||
|
except Exception, e:
|
||||||
|
LOG.error(_("_fix_instance_nw_info failed: %s") %
|
||||||
|
(e))
|
||||||
|
|
||||||
def _get_instance_root_device_name(self, pvc_instance, db_instance):
|
def _get_instance_root_device_name(self, pvc_instance, db_instance):
|
||||||
root_device_name = '/dev/sda'
|
root_device_name = '/dev/sda'
|
||||||
|
|||||||
Reference in New Issue
Block a user