def handle(self, request, data): image_id = data["image_id"] try: api.image_delete(request, image_id) except glance_exception.ClientConnectionError, e: LOG.exception("Error connecting to glance") messages.error(request, _("Error connecting to glance: %s") % e.message)
def handle(self, request, data): image_id = data['image_id'] try: api.image_delete(request, image_id) except glance_exception.ClientConnectionError, e: LOG.exception("Error connecting to glance") messages.error(request, _("Error connecting to glance: %s") % e.message)
def handle(self, request, data): image_id = data['image_id'] tenant_id = request.user.tenant_id try: image = api.image_get_meta(request, image_id) if image.owner == request.user.username: api.image_delete(request, image_id) else: messages.info(request, _("Unable to delete image, you are not \ its owner.")) return redirect('dash_images_update', tenant_id, image_id) except glance_exception.ClientConnectionError, e: LOG.exception("Error connecting to glance") messages.error(request, _("Error connecting to glance: %s") % e.message)
def handle(self, request, data): image_id = data['image_id'] tenant_id = request.user.tenant_id try: image = api.image_get_meta(request, image_id) if image.owner == request.user.username: api.image_delete(request, image_id) else: messages.info( request, _("Unable to delete image, you are not \ its owner.")) return redirect('dash_images_update', tenant_id, image_id) except glance_exception.ClientConnectionError, e: LOG.exception("Error connecting to glance") messages.error(request, _("Error connecting to glance: %s") % e.message)
def delete(self, request, obj_id): api.image_delete(request, obj_id)