'Appends the image metadata to each of the given volume.
:param context: the request context
:param resp_volume_list: the response volume list
:param image_metas: The image metadata to append, if None is provided
it will be retrieved from the database. An empty
dict means there is no metadata and it should not
be retrieved from the db.'

def _add_image_metadata(self, context, resp_volume_list, image_metas=None):

    vol_id_list = []
    for vol in resp_volume_list:
        vol_id_list.append(vol['id'])
    if (image_metas is None):
        try:
            image_metas = self.volume_api.get_list_volumes_image_metadata(context, vol_id_list)
        except Exception as e:
            LOG.debug('Get    image    metadata    error:    %s', e)
            return
    if image_metas:
        for vol in resp_volume_list:
            image_meta = image_metas.get(vol['id'])
            if image_meta:
                vol['volume_image_metadata'] = dict(image_meta)
