if image_dict['location'] is not None:
image_vim_id = vim.get_image_id_from_path(image_dict['location'])
else:
- filter_dict={}
- filter_dict['name']=image_dict['universal_name']
- filter_dict['checksum']=image_dict['checksum']
+ filter_dict = {}
+ filter_dict['name'] = image_dict['universal_name']
+ if image_dict.get('checksum') != None:
+ 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
logger.warn("Error contacting VIM to know if the image exists at VIM: %s", str(e))
image_vim_id = None
- continue
+ continue
#if we reach here, the image has been created or existed
if len(image_db)==0:
#add new vim_id at datacenters_images
myvims[d] = v
datacenter2tenant[d] = v['config']['datacenter_tenant_id']
scenario_vnf["datacenter"] = vnf_instance_desc["datacenter"]
+
#0.1 parse cloud-config parameters
cloud_config = scenarioDict.get("cloud-config", {})
if instance_dict.get("cloud-config"):
filtered_list = []
for image in image_list:
image_dict=self.glance.images.get(image.id)
- if filter_dict.get('checksum') == None or image_dict['checksum']==filter_dict.get('checksum'):
+ if 'checksum' in filter_dict and image_dict['checksum']==filter_dict.get('checksum'):
filtered_list.append(image)
return filtered_list
except (ksExceptions.ClientException, nvExceptions.ClientException, gl1Exceptions.CommunicationError, ConnectionError) as e: