def delete(self, image_id): for i, image in enumerate(self._images): if image.id == image_id: # When you delete an image from glance, it sets the status to # DELETED. If you try to delete a DELETED image, it raises # HTTPForbidden. image_data = self._images[i] if image_data.deleted: raise exception.Forbidden() image_data.deleted = True return raise exception.NotFound(image_id)
def get(self, image_id): raise exception.Forbidden(image_id)