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
This commit is contained in:
parent
fdc150fe98
commit
102f505851
|
@ -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):
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue