From d562012f34eadfe6b68dd5ebe06a2fa565de3b2e Mon Sep 17 00:00:00 2001 From: Aaron Rosen Date: Fri, 15 Feb 2013 10:41:00 -0800 Subject: Make nova security groups more pluggable This patch moves the nova security group code out of nova/compute/api.py into nova/network/security_group. It also removes any query to the database from security group api into the nova security group driver. This allows security group drivers the ability to decouple themselves from storing security group information in the nova_db. Change-Id: Ib183515a0418203c8bcc88176e3a1498d7333300 --- nova/tests/compute/test_compute.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 6eb5feb85..542a7e162 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -46,6 +46,7 @@ from nova import exception from nova.image import glance from nova.network import api as network_api from nova.network import model as network_model +from nova.network.security_group import openstack_driver from nova.openstack.common import importutils from nova.openstack.common import jsonutils from nova.openstack.common import log as logging @@ -69,7 +70,6 @@ from nova import utils from nova.virt import fake from nova.volume import cinder - QUOTAS = quota.QUOTAS LOG = logging.getLogger(__name__) CONF = cfg.CONF @@ -3649,7 +3649,9 @@ class ComputeAPITestCase(BaseTestCase): super(ComputeAPITestCase, self).setUp() self.stubs.Set(network_api.API, 'get_instance_nw_info', fake_get_nw_info) - self.security_group_api = compute_api.SecurityGroupAPI() + self.security_group_api = ( + openstack_driver.get_openstack_security_group_driver()) + self.compute_api = compute.API( security_group_api=self.security_group_api) self.fake_image = { -- cgit