'Sanity check the \'deleted\' and \'size\' metadata values.'

def _verify_metadata(self, image_meta):

    if ((image_meta['status'] == 'deleted') and image_meta['deleted']):
        raise exception.NotFound()
    if (not image_meta['size']):
        if (not isinstance(image_meta, policy.ImageTarget)):
            image_meta['size'] = self.cache.get_image_size(image_meta['id'])
        else:
            image_meta.target.size = self.cache.get_image_size(image_meta['id'])
