From 20f0c601fe5bd59c2a2f07a8be428ddca995afc5 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 12 Dec 2012 13:06:30 -0800 Subject: Move provider_fw_rule_get_all to conductor This patch moves the compute/manager's use of the provider_fw_rule_get_all() method to the conductor. Related to blueprint no-db-compute-manager Change-Id: I963fc65046d29b6eb92b82d559593a64ff775632 --- nova/tests/compute/test_virtapi.py | 4 ++-- nova/tests/conductor/test_conductor.py | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/compute/test_virtapi.py b/nova/tests/compute/test_virtapi.py index 22ddd8ca5..ceeacbc9d 100644 --- a/nova/tests/compute/test_virtapi.py +++ b/nova/tests/compute/test_virtapi.py @@ -140,9 +140,9 @@ class ComputeVirtAPITest(VirtAPIBaseTest): 'aggregate_metadata_delete', 'security_group_get_by_instance', 'security_group_rule_get_by_security_group', + 'provider_fw_rule_get_all', ] - self.db_methods = ['provider_fw_rule_get_all', - 'agent_build_get_by_triple', + self.db_methods = ['agent_build_get_by_triple', ] def assertExpected(self, method, *args, **kwargs): diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py index 8d811e27c..6acbe7ef6 100644 --- a/nova/tests/conductor/test_conductor.py +++ b/nova/tests/conductor/test_conductor.py @@ -243,6 +243,14 @@ class _BaseTestCase(object): self.context, fake_secgroup) self.assertEqual(result, 'it worked') + def test_provider_fw_rule_get_all(self): + fake_rules = ['a', 'b', 'c'] + self.mox.StubOutWithMock(db, 'provider_fw_rule_get_all') + db.provider_fw_rule_get_all(self.context).AndReturn(fake_rules) + self.mox.ReplayAll() + result = self.conductor.provider_fw_rule_get_all(self.context) + self.assertEqual(result, fake_rules) + class ConductorTestCase(_BaseTestCase, test.TestCase): """Conductor Manager Tests""" -- cgit