コード例 #1
0
 def delete(self, req, type_id, id):
     """ Deletes an existing extra spec """
     context = req.environ['cinder.context']
     self._check_type(context, type_id)
     authorize(context)
     db.volume_type_extra_specs_delete(context, type_id, id)
     return webob.Response(status_int=202)
コード例 #2
0
 def delete(self, req, type_id, id):
     """ Deletes an existing extra spec """
     context = req.environ['cinder.context']
     self._check_type(context, type_id)
     authorize(context)
     db.volume_type_extra_specs_delete(context, type_id, id)
     return webob.Response(status_int=202)
コード例 #3
0
 def test_volume_type_extra_specs_delete(self):
     expected_specs = self.vol_type1_specs.copy()
     del expected_specs['vol_extra2']
     db.volume_type_extra_specs_delete(context.get_admin_context(),
                                       self.volume_type1_id, 'vol_extra2')
     actual_specs = db.volume_type_extra_specs_get(
         context.get_admin_context(), self.volume_type1_id)
     self.assertEquals(expected_specs, actual_specs)
コード例 #4
0
 def test_volume_type_extra_specs_delete(self):
     expected_specs = self.vol_type1_specs.copy()
     del expected_specs['vol_extra2']
     db.volume_type_extra_specs_delete(context.get_admin_context(),
                                       self.volume_type1_id,
                                       'vol_extra2')
     actual_specs = db.volume_type_extra_specs_get(
         context.get_admin_context(),
         self.volume_type1_id)
     self.assertEqual(expected_specs, actual_specs)
コード例 #5
0
 def delete(self, req, type_id, id):
     """ Deletes an existing extra spec """
     context = req.environ['cinder.context']
     self._check_type(context, type_id)
     authorize(context)
     db.volume_type_extra_specs_delete(context, type_id, id)
     notifier_info = dict(type_id=type_id, id=id)
     notifier_api.notify(context, 'volumeTypeExtraSpecs',
                         'volume_type_extra_specs.delete',
                         notifier_api.INFO, notifier_info)
     return webob.Response(status_int=202)
コード例 #6
0
ファイル: types_extra_specs.py プロジェクト: schatt/cinder
 def delete(self, req, type_id, id):
     """ Deletes an existing extra spec """
     context = req.environ['cinder.context']
     self._check_type(context, type_id)
     authorize(context)
     db.volume_type_extra_specs_delete(context, type_id, id)
     notifier_info = dict(type_id=type_id, id=id)
     notifier_api.notify(context, 'volumeTypeExtraSpecs',
                         'volume_type_extra_specs.delete',
                         notifier_api.INFO, notifier_info)
     return webob.Response(status_int=202)
コード例 #7
0
    def delete(self, req, type_id, id):
        """Deletes an existing extra spec."""
        context = req.environ['cinder.context']
        self._check_type(context, type_id)
        authorize(context)
        self._allow_update(context, type_id)

        # Not found exception will be handled at the wsgi level
        db.volume_type_extra_specs_delete(context, type_id, id)

        notifier_info = dict(type_id=type_id, id=id)
        notifier = rpc.get_notifier('volumeTypeExtraSpecs')
        notifier.info(context, 'volume_type_extra_specs.delete', notifier_info)
        return webob.Response(status_int=http_client.ACCEPTED)
コード例 #8
0
ファイル: types_extra_specs.py プロジェクト: bopopescu/stack
    def delete(self, req, type_id, id):
        """Deletes an existing extra spec."""
        context = req.environ['cinder.context']
        self._check_type(context, type_id)
        authorize(context)

        try:
            db.volume_type_extra_specs_delete(context, type_id, id)
        except exception.VolumeTypeExtraSpecsNotFound as error:
            raise webob.exc.HTTPNotFound(explanation=error.msg)

        notifier_info = dict(type_id=type_id, id=id)
        notifier = rpc.get_notifier('volumeTypeExtraSpecs')
        notifier.info(context, 'volume_type_extra_specs.delete', notifier_info)
        return webob.Response(status_int=202)
コード例 #9
0
ファイル: types_extra_specs.py プロジェクト: C2python/cinder
    def delete(self, req, type_id, id):
        """Deletes an existing extra spec."""
        context = req.environ['cinder.context']
        self._check_type(context, type_id)
        authorize(context)

        # Not found exception will be handled at the wsgi level
        db.volume_type_extra_specs_delete(context, type_id, id)

        notifier_info = dict(type_id=type_id, id=id)
        notifier = rpc.get_notifier('volumeTypeExtraSpecs')
        notifier.info(context,
                      'volume_type_extra_specs.delete',
                      notifier_info)
        return webob.Response(status_int=202)
コード例 #10
0
    def delete(self, req, type_id, id):
        """Deletes an existing extra spec."""
        context = req.environ["cinder.context"]
        self._check_type(context, type_id)
        authorize(context)

        try:
            db.volume_type_extra_specs_delete(context, type_id, id)
        except exception.VolumeTypeExtraSpecsNotFound as error:
            raise webob.exc.HTTPNotFound(explanation=error.msg)

        notifier_info = dict(type_id=type_id, id=id)
        notifier = rpc.get_notifier("volumeTypeExtraSpecs")
        notifier.info(context, "volume_type_extra_specs.delete", notifier_info)
        return webob.Response(status_int=202)
コード例 #11
0
ファイル: types_extra_specs.py プロジェクト: ArikaChen/cinder
    def delete(self, req, type_id, id):
        """ Deletes an existing extra spec """
        context = req.environ['cinder.context']
        self._check_type(context, type_id)
        authorize(context)

        try:
            db.volume_type_extra_specs_delete(context, type_id, id)
        except exception.VolumeTypeExtraSpecsNotFound as error:
            raise webob.exc.HTTPNotFound(explanation=unicode(error))

        notifier_info = dict(type_id=type_id, id=id)
        notifier_api.notify(context, 'volumeTypeExtraSpecs',
                            'volume_type_extra_specs.delete',
                            notifier_api.INFO, notifier_info)
        return webob.Response(status_int=202)
コード例 #12
0
ファイル: types_extra_specs.py プロジェクト: lubidl0/cinder-1
    def delete(self, req, type_id, id):
        """Deletes an existing extra spec."""
        context = req.environ['cinder.context']
        self._check_type(context, type_id)
        context.authorize(policy.DELETE_POLICY)
        self._allow_update(context, type_id)

        # Not found exception will be handled at the wsgi level
        db.volume_type_extra_specs_delete(context, type_id, id)

        # Get created_at and updated_at for notification
        volume_type = volume_types.get_volume_type(context, type_id)
        notifier_info = dict(type_id=type_id,
                             id=id,
                             created_at=volume_type['created_at'],
                             updated_at=volume_type['updated_at'],
                             deleted_at=volume_type['deleted_at'])
        notifier = rpc.get_notifier('volumeTypeExtraSpecs')
        notifier.info(context, 'volume_type_extra_specs.delete', notifier_info)
コード例 #13
0
    def delete(self, req, type_id, id):
        """Deletes an existing extra spec."""
        context = req.environ['cinder.context']
        self._check_type(context, type_id)
        context.authorize(policy.DELETE_POLICY)
        self._allow_update(context, type_id)

        # Not found exception will be handled at the wsgi level
        db.volume_type_extra_specs_delete(context, type_id, id)

        # Get created_at and updated_at for notification
        volume_type = volume_types.get_volume_type(context, type_id)
        notifier_info = dict(type_id=type_id, id=id,
                             created_at=volume_type['created_at'],
                             updated_at=volume_type['updated_at'],
                             deleted_at=volume_type['deleted_at'])
        notifier = rpc.get_notifier('volumeTypeExtraSpecs')
        notifier.info(context,
                      'volume_type_extra_specs.delete',
                      notifier_info)