Remove old flavor_extra_specs_delete db api method
We haven't used this since the flavor migration compat code was removed: I4107af592448e20fe929f8fa3112929e3685b581 Change-Id: Ic75e1a892ea5093175a8ac981249b56e5962a906
This commit is contained in:
parent
27c7c88737
commit
0eca044521
|
@ -1573,11 +1573,6 @@ def flavor_extra_specs_get(context, flavor_id):
|
|||
"""Get all extra specs for an instance type."""
|
||||
return IMPL.flavor_extra_specs_get(context, flavor_id)
|
||||
|
||||
|
||||
def flavor_extra_specs_delete(context, flavor_id, key):
|
||||
"""Delete the given extra specs item."""
|
||||
IMPL.flavor_extra_specs_delete(context, flavor_id, key)
|
||||
|
||||
####################
|
||||
|
||||
|
||||
|
|
|
@ -4850,18 +4850,6 @@ def flavor_extra_specs_get(context, flavor_id):
|
|||
return {row['key']: row['value'] for row in rows}
|
||||
|
||||
|
||||
@require_context
|
||||
@pick_context_manager_writer
|
||||
def flavor_extra_specs_delete(context, flavor_id, key):
|
||||
result = _flavor_extra_specs_get_query(context, flavor_id).\
|
||||
filter(models.InstanceTypeExtraSpecs.key == key).\
|
||||
soft_delete(synchronize_session=False)
|
||||
# did not find the extra spec
|
||||
if result == 0:
|
||||
raise exception.FlavorExtraSpecsNotFound(
|
||||
extra_specs_key=key, flavor_id=flavor_id)
|
||||
|
||||
|
||||
####################
|
||||
|
||||
|
||||
|
|
|
@ -4765,21 +4765,6 @@ class InstanceTypeExtraSpecsTestCase(BaseInstanceTypeTestCase):
|
|||
real_specs = db.flavor_extra_specs_get(self.ctxt, it['flavorid'])
|
||||
self._assertEqualObjects(it['extra_specs'], real_specs)
|
||||
|
||||
def test_flavor_extra_specs_delete(self):
|
||||
for it in self.flavors:
|
||||
specs = it['extra_specs']
|
||||
key = list(specs.keys())[0]
|
||||
del specs[key]
|
||||
db.flavor_extra_specs_delete(self.ctxt, it['flavorid'], key)
|
||||
real_specs = db.flavor_extra_specs_get(self.ctxt, it['flavorid'])
|
||||
self._assertEqualObjects(it['extra_specs'], real_specs)
|
||||
|
||||
def test_flavor_extra_specs_delete_failed(self):
|
||||
for it in self.flavors:
|
||||
self.assertRaises(exception.FlavorExtraSpecsNotFound,
|
||||
db.flavor_extra_specs_delete,
|
||||
self.ctxt, it['flavorid'], 'dummy')
|
||||
|
||||
|
||||
class InstanceTypeAccessTestCase(BaseInstanceTypeTestCase):
|
||||
|
||||
|
|
Loading…
Reference in New Issue