From 5a89fe11f1efb1136758f4dc20ae0854fcf41b59 Mon Sep 17 00:00:00 2001 From: Aaron Rosen Date: Mon, 6 May 2013 22:42:51 -0700 Subject: Remove security_group_handler Now that nova's security groups are more plugable and decoupled from the database the security_group_handler code is not very useful so this patch removes it. A little info about the security_group_handler: The security_group_handle code was added to provide a hook into nova security groups so that one could get security group add/delete/update notification and proxy them somewhere else (i.e quantum). Trying to actually using this method opens one up to several transactional issues because in the current implemenation the security group is commited to the nova database before security_group_handler is called. Implements blueprint: remove-security-group-handler Change-Id: I45047fe8dbb81555505e03309838910113080c37 --- .../compute/contrib/test_security_group_default_rules.py | 2 +- nova/tests/network/test_manager.py | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/api/openstack/compute/contrib/test_security_group_default_rules.py b/nova/tests/api/openstack/compute/contrib/test_security_group_default_rules.py index 2b4145764..0528c09f5 100644 --- a/nova/tests/api/openstack/compute/contrib/test_security_group_default_rules.py +++ b/nova/tests/api/openstack/compute/contrib/test_security_group_default_rules.py @@ -282,7 +282,7 @@ class TestSecurityGroupDefaultRules(test.TestCase): setattr(ctxt, 'project_id', 'new_project_id') - _, sg = nova.db.security_group_ensure_default(ctxt) + sg = nova.db.security_group_ensure_default(ctxt) rules = nova.db.security_group_rule_get_by_security_group(ctxt, sg.id) security_group_rule = rules[0] self.assertEqual(sgr['id'], security_group_rule.id) diff --git a/nova/tests/network/test_manager.py b/nova/tests/network/test_manager.py index b47987b52..3fe2d6c74 100644 --- a/nova/tests/network/test_manager.py +++ b/nova/tests/network/test_manager.py @@ -316,9 +316,6 @@ class FlatNetworkTestCase(test.TestCase): mox.IgnoreArg(), mox.IgnoreArg()).AndReturn('192.168.0.101') - db.instance_get_by_uuid(mox.IgnoreArg(), - mox.IgnoreArg()).AndReturn({'security_groups': - [{'id': 0}]}) db.instance_get_by_uuid(mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'security_groups': [{'id': 0, 'name': 'test'}]}) @@ -362,9 +359,6 @@ class FlatNetworkTestCase(test.TestCase): mox.IgnoreArg(), mox.IgnoreArg()).AndReturn('192.168.0.101') - db.instance_get_by_uuid(mox.IgnoreArg(), - mox.IgnoreArg()).AndReturn({'security_groups': - [{'id': 0}]}) db.instance_get_by_uuid(mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'security_groups': [{'id': 0, 'name': 'test'}]}) @@ -452,9 +446,6 @@ class FlatNetworkTestCase(test.TestCase): mox.IgnoreArg(), mox.IgnoreArg()).AndReturn(fixedip) - db.instance_get_by_uuid(mox.IgnoreArg(), - mox.IgnoreArg()).AndReturn({'security_groups': - [{'id': 0}]}) db.instance_get_by_uuid(mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'security_groups': [{'id': 0, 'name': 'test'}]}) -- cgit