From b09dabae177d4eb1dc5ba19d0c7962c7fec9faad Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 11 Jan 2013 09:54:07 -0500 Subject: Allow forcing local conductor. This patch updates the conductor API to allow passing in a kwarg to force local usage, even if configured for remote usage globally. This is useful if we want to convert some parts of the code to use conductor db proxy APIs, but want to optimize usage to be local for cases where using the db directly is not a problem. Part of bp no-db-compute. Change-Id: Ib7a717e1a6f132022787626e65cacaa8a4afd86c --- nova/tests/conductor/test_conductor.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py index 7986fc583..909174fa9 100644 --- a/nova/tests/conductor/test_conductor.py +++ b/nova/tests/conductor/test_conductor.py @@ -700,6 +700,11 @@ class ConductorImportTest(test.TestCase): self.assertTrue(isinstance(conductor.API(), conductor_api.API)) + def test_import_conductor_override_to_local(self): + self.flags(use_local=False, group='conductor') + self.assertTrue(isinstance(conductor.API(use_local=True), + conductor_api.LocalAPI)) + class ConductorPolicyTest(test.TestCase): def test_all_allowed_keys(self): -- cgit