From 36aded18660fc4d515aaabfc7bf1afbfb65e6411 Mon Sep 17 00:00:00 2001 From: James Page Date: Thu, 5 Oct 2017 10:27:18 +0100 Subject: Prefer SNAP_COMMON config files 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 --- oslo_config/tests/test_cfg.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'oslo_config/tests/test_cfg.py') 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'] -- cgit v1.2.1