From 3a92a9efe90f7b186653d89b45d5468fc0b0543f Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Tue, 15 Jan 2013 13:15:12 +0400 Subject: Remove restoring soft deleted entries part 1 There is no need to reuse deleted entries, because they will be archived after db-archiving implementation. And restoring soft deleted entries produce some problem with db-unique-keys implementation. So the best way is to remove it. instance_type_access_add() method Remove restoring soft deleted instance_type_access entries instance_type_extra_specs_update_or_create() method Remove restoring soft deleted instance_type_extra_specs entries Add missing transaction aggregate_host_add() method Remove restoring soft deleted aggreagate_hosts entries Add missing transaction blueprint db-session-cleanup Change-Id: Ida7db95233c40faacac55105650f52d42ad360c2 --- nova/tests/test_instance_types_extra_specs.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/test_instance_types_extra_specs.py b/nova/tests/test_instance_types_extra_specs.py index f53840b86..f48c2efe8 100644 --- a/nova/tests/test_instance_types_extra_specs.py +++ b/nova/tests/test_instance_types_extra_specs.py @@ -18,6 +18,7 @@ Unit Tests for instance types extra specs code from nova import context from nova import db +from nova import exception from nova import test @@ -87,6 +88,13 @@ class InstanceTypeExtraSpecsTestCase(test.TestCase): self.flavorid) self.assertEquals(expected_specs, actual_specs) + def test_instance_type_extra_specs_update_with_nonexisting_flavor(self): + extra_specs = dict(cpu_arch="x86_64") + nonexisting_flavorid = "some_flavor_that_doesnt_exists" + self.assertRaises(exception.FlavorNotFound, + db.instance_type_extra_specs_update_or_create, + self.context, nonexisting_flavorid, extra_specs) + def test_instance_type_extra_specs_create(self): expected_specs = dict(cpu_arch="x86_64", cpu_model="Nehalem", -- cgit