summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Nash <henryn@linux.vnet.ibm.com>2015-04-02 07:54:29 +0100
committerHenry Nash <henryn@linux.vnet.ibm.com>2015-04-03 06:31:25 +0100
commit102f5058515460b1c8331f78a9845722c75e6e3c (patch)
treefa626e7044c0a57252ec8153da824089cbc8d6f7
parentfdc150fe98be693bdc7a61b87efc492ccc693210 (diff)
downloadkeystone-102f5058515460b1c8331f78a9845722c75e6e3c.tar.gz
Fix multiple SQL backend usage validation error
This patch fixes an error in the file-based domain-specific configuration support where the method to spot multiple SQL drivers would fail to remember previous instances of this. The fix is simply to OR the previous cumulative memory of SQL drivers with the state of the one being requested. Change-Id: I87314a5806a5652695ef17f74f70165b8e3347c2 Closes-Bug: #1410850
-rw-r--r--keystone/identity/core.py2
-rw-r--r--keystone/tests/unit/identity/test_core.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/keystone/identity/core.py b/keystone/identity/core.py
index a2f017f17..60ccf75a8 100644
--- a/keystone/identity/core.py
+++ b/keystone/identity/core.py
@@ -111,7 +111,7 @@ class DomainConfigs(dict):
if not config_file:
config_file = _('Database at /domains/%s/config') % domain_id
raise exception.MultipleSQLDriversInConfig(source=config_file)
- self._any_sql = new_config['driver'].is_sql
+ self._any_sql = self._any_sql or new_config['driver'].is_sql
def _load_config_from_file(self, resource_api, file_list, domain_name):
diff --git a/keystone/tests/unit/identity/test_core.py b/keystone/tests/unit/identity/test_core.py
index 7d0a75836..8c3fc6031 100644
--- a/keystone/tests/unit/identity/test_core.py
+++ b/keystone/tests/unit/identity/test_core.py
@@ -113,9 +113,9 @@ class TestDomainConfigs(tests.BaseTestCase):
with mock.patch.object(identity.cfg, 'ConfigOpts'):
with mock.patch.object(domains_config, '_load_driver',
load_driver_mock):
- # TODO(henry-nash): The following call should fail since
- # we are asking for two sql drivers. See bug #1410850.
- domains_config.setup_domain_drivers(
+ self.assertRaises(
+ exception.MultipleSQLDriversInConfig,
+ domains_config.setup_domain_drivers,
generic_driver, assignment_api)
self.assertEqual(3, load_driver_mock.call_count)