diff options
author | James Page <james.page@ubuntu.com> | 2017-10-05 10:27:18 +0100 |
---|---|---|
committer | James Page <james.page@ubuntu.com> | 2017-10-06 09:03:53 +0100 |
commit | 36aded18660fc4d515aaabfc7bf1afbfb65e6411 (patch) | |
tree | 6fafa92e5a0f5114fc9b2a470b2d4b8b2585d35c /oslo_config/tests/test_cfg.py | |
parent | 0cce0be52abddc670f8d7451f240481eaa9fe208 (diff) | |
download | oslo-config-36aded18660fc4d515aaabfc7bf1afbfb65e6411.tar.gz |
Prefer SNAP_COMMON config files4.13.2
User provided configuration files in $SNAP_COMMON should always
be preferred over snap provided default config files in $SNAP.
Re-order the target location list in _get_config_dirs to ensure
that files in $SNAP_COMMON are selected over those in $SNAP.
Change-Id: I7cba87ab328edc05b1e6edd1ff512e8fd5192638
Diffstat (limited to 'oslo_config/tests/test_cfg.py')
-rw-r--r-- | oslo_config/tests/test_cfg.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/oslo_config/tests/test_cfg.py b/oslo_config/tests/test_cfg.py index 67d9c43..4e7f58c 100644 --- a/oslo_config/tests/test_cfg.py +++ b/oslo_config/tests/test_cfg.py @@ -224,7 +224,8 @@ class FindConfigFilesTestCase(BaseTestCase): self.assertEqual(cfg.find_config_files(project='blaa'), config_files) def test_find_config_files_snap(self): - config_files = ['/snap/nova/current/etc/blaa/blaa.conf'] + config_files = ['/snap/nova/current/etc/blaa/blaa.conf', + '/var/snap/nova/common/etc/blaa/blaa.conf'] fake_env = {'SNAP': '/snap/nova/current/', 'SNAP_COMMON': '/var/snap/nova/common/'} @@ -233,7 +234,8 @@ class FindConfigFilesTestCase(BaseTestCase): lambda p: p in config_files)) self.useFixture(fixtures.MonkeyPatch('os.environ', fake_env)) - self.assertEqual(cfg.find_config_files(project='blaa'), config_files) + self.assertEqual(cfg.find_config_files(project='blaa'), + ['/var/snap/nova/common/etc/blaa/blaa.conf']) def test_find_config_files_with_extension(self): config_files = ['/etc/foo.json'] |