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())
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())
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 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)
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()
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)
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)