Change-Id: Ia4d42dc5f69f07f2f3646916cfd6d414b702c5ea
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
#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)
+ raise vimconn.vimconnException("More than one candidate VIM image found for filter: {}".format(str(filter_dict)), HTTP_Conflict)
elif len(vim_images) == 0:
- raise NfvoException("Image not found at VIM with filter: '%s'", str(filter_dict))
+ raise vimconn.vimconnNotFoundException("Image not found at VIM with filter: '{}'".format(str(filter_dict)))
else:
image_vim_id = vim_images[0].id
filtered_list = []
for image in image_list:
image_dict=self.glance.images.get(image.id)
- if image_dict['checksum']==filter_dict.get('checksum'):
+ if filter_dict.get('checksum') == None or image_dict['checksum']==filter_dict.get('checksum'):
filtered_list.append(image)
return filtered_list
except (ksExceptions.ClientException, nvExceptions.ClientException, gl1Exceptions.CommunicationError, ConnectionError) as e: