From: garciadeblas Date: Fri, 30 Sep 2016 14:02:09 +0000 (+0000) Subject: Fixed issue when using VM image name instead of path in deployments on openstack X-Git-Tag: v1.0.0~10 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=bb6a1eddea58a499539b13859b0cff1964fd554e;p=osm%2FRO.git Fixed issue when using VM image name instead of path in deployments on openstack Signed-off-by: garciadeblas --- diff --git a/nfvo.py b/nfvo.py index b0936e27..e8032064 100644 --- a/nfvo.py +++ b/nfvo.py @@ -284,10 +284,11 @@ def create_or_use_image(mydb, vims, image_dict, rollback_list, only_create_at_vi filter_dict={} filter_dict['name']=image_dict['universal_name'] filter_dict['checksum']=image_dict['checksum'] + #logger.debug('>>>>>>>> Filter dict: %s', str(filter_dict)) vim_images = vim.get_image_list(filter_dict) if len(vim_images) > 1: raise NfvoException("More than one candidate VIM image found for filter: " + str(filter_dict), HTTP_Conflict) - elif len(vim_nets) == 0: + elif len(vim_images) == 0: raise NfvoException("Image not found at VIM with filter: '%s'", str(filter_dict)) else: image_vim_id = vim_images[0].id @@ -1688,9 +1689,9 @@ def create_instance(mydb, tenant_id, instance_dict): #print "Checking that the scenario exists and getting the scenario dictionary" scenarioDict = mydb.get_scenario(scenario, tenant_id, default_datacenter_id) - #logger.debug("Dictionaries before merging") - #logger.debug("InstanceDict:\n{}".format(yaml.safe_dump(instance_dict,default_flow_style=False, width=256))) - #logger.debug("ScenarioDict:\n{}".format(yaml.safe_dump(scenarioDict,default_flow_style=False, width=256))) + #logger.debug(">>>>>>> Dictionaries before merging") + #logger.debug(">>>>>>> InstanceDict:\n{}".format(yaml.safe_dump(instance_dict,default_flow_style=False, width=256))) + #logger.debug(">>>>>>> ScenarioDict:\n{}".format(yaml.safe_dump(scenarioDict,default_flow_style=False, width=256))) scenarioDict['datacenter_tenant_id'] = default_datacenter_tenant_id scenarioDict['datacenter_id'] = default_datacenter_id @@ -1780,7 +1781,7 @@ def create_instance(mydb, tenant_id, instance_dict): if interface['vnf_interface'] == vnf_interface['external_name']: vnf_interface['ip_address']=interface['ip_address'] - #logger.debug("Merged dictionary") + #logger.debug(">>>>>>>> Merged dictionary") logger.debug("Creating instance scenario-dict MERGED:\n%s", yaml.safe_dump(scenarioDict, indent=4, default_flow_style=False)) diff --git a/vimconn_openstack.py b/vimconn_openstack.py index 0fc5bbda..e0a3aa31 100644 --- a/vimconn_openstack.py +++ b/vimconn_openstack.py @@ -600,7 +600,7 @@ class vimconnector(vimconn.vimconnector): #Then we filter by the rest of filter fields: checksum filtered_list = [] for image in image_list: - image_dict=glance.images.get(image.id) + image_dict=self.glance.images.get(image.id) if image_dict['checksum']==filter_dict.get('checksum'): filtered_list.append(image) return filtered_list