Пример #1
0
 def delete(self, req, flavor_id, id):
     """Deletes an existing extra spec."""
     context = req.environ["nova.context"]
     self.authorize(context, action="delete")
     try:
         db.instance_type_extra_specs_delete(context, flavor_id, id)
     except exception.InstanceTypeExtraSpecsNotFound as e:
         raise webob.exc.HTTPNotFound(explanation=e.format_message())
Пример #2
0
 def delete(self, req, flavor_id, id):
     """Deletes an existing extra spec."""
     context = req.environ['nova.context']
     self.authorize(context, action='delete')
     try:
         db.instance_type_extra_specs_delete(context, flavor_id, id)
     except exception.InstanceTypeExtraSpecsNotFound as e:
         raise webob.exc.HTTPNotFound(explanation=e.format_message())
Пример #3
0
 def test_instance_type_extra_specs_delete(self):
     expected_specs = dict(cpu_arch="x86_64",
                           cpu_model="Nehalem",
                           xpu_arch="fermi",
                           xpus="2")
     db.instance_type_extra_specs_delete(self.context, self.flavorid,
                                         "xpu_model")
     actual_specs = db.instance_type_extra_specs_get(
         self.context, self.flavorid)
     self.assertEquals(expected_specs, actual_specs)
 def test_instance_type_extra_specs_delete(self):
     expected_specs = dict(cpu_arch="x86_64",
                              cpu_model="Nehalem",
                              xpu_arch="fermi",
                              xpus="2")
     db.instance_type_extra_specs_delete(self.context,
                                   self.flavorid,
                                   "xpu_model")
     actual_specs = db.instance_type_extra_specs_get(
                           self.context,
                           self.flavorid)
     self.assertEquals(expected_specs, actual_specs)
Пример #5
0
    def unset_key(self, name, key):
        """Delete the specified extra spec for instance type."""
        try:
            try:
                inst_type = flavors.get_instance_type_by_name(name)
            except exception.InstanceTypeNotFoundByName as e:
                print e
                return 2

            ctxt = context.get_admin_context()
            db.instance_type_extra_specs_delete(ctxt, inst_type["flavorid"], key)

            print _("Key %(key)s on instance type %(name)s unset") % locals()
        except db_exc.DBError as e:
            _db_error(e)
Пример #6
0
    def unset_key(self, name, key):
        """Delete the specified extra spec for instance type."""
        try:
            try:
                inst_type = instance_types.get_instance_type_by_name(name)
            except exception.InstanceTypeNotFoundByName, e:
                print e
                return(2)

            ctxt = context.get_admin_context()
            db.instance_type_extra_specs_delete(
                        ctxt,
                        inst_type["flavorid"],
                        key)

            print _("Key %(key)s on instance type %(name)s unset") % locals()
Пример #7
0
 def delete(self, req, flavor_id, id):
     """ Deletes an existing extra spec """
     context = req.environ['nova.context']
     db.instance_type_extra_specs_delete(context, flavor_id, id)
Пример #8
0
 def delete(self, req, flavor_id, id):
     """ Deletes an existing extra spec """
     context = req.environ['nova.context']
     db.instance_type_extra_specs_delete(context, flavor_id, id)
Пример #9
0
 def delete(self, req, flavor_id, id):
     """Deletes an existing extra spec."""
     context = req.environ['nova.context']
     authorize(context, action='delete')
     db.instance_type_extra_specs_delete(context, flavor_id, id)
Пример #10
0
 def delete(self, req, flavor_id, id):
     """Deletes an existing extra spec."""
     context = req.environ['nova.context']
     authorize(context, action='delete')
     db.instance_type_extra_specs_delete(context, flavor_id, id)