def _delete(self, req, id):
        """Deletes an existing storage type."""
        context = req.environ['vsm.context']
        authorize(context)

        try:
            vol_type = storage_types.get_storage_type(context, id)
            storage_types.destroy(context, vol_type['id'])
        except exception.NotFound:
            raise webob.exc.HTTPNotFound()

        return webob.Response(status_int=202)
Esempio n. 2
0
    def _delete(self, req, id):
        """Deletes an existing storage type."""
        context = req.environ['vsm.context']
        authorize(context)

        try:
            vol_type = storage_types.get_storage_type(context, id)
            storage_types.destroy(context, vol_type['id'])
        except exception.NotFound:
            raise webob.exc.HTTPNotFound()

        return webob.Response(status_int=202)
Esempio n. 3
0
 def _check_type(self, context, type_id):
     try:
         storage_types.get_storage_type(context, type_id)
     except exception.NotFound as ex:
         raise webob.exc.HTTPNotFound(explanation=unicode(ex))
 def _check_type(self, context, type_id):
     try:
         storage_types.get_storage_type(context, type_id)
     except exception.NotFound as ex:
         raise webob.exc.HTTPNotFound(explanation=unicode(ex))