summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oslo_config/cfg.py8
-rw-r--r--oslo_config/tests/test_cfg.py6
2 files changed, 8 insertions, 6 deletions
diff --git a/oslo_config/cfg.py b/oslo_config/cfg.py
index cbdcdfa..662afa6 100644
--- a/oslo_config/cfg.py
+++ b/oslo_config/cfg.py
@@ -656,8 +656,8 @@ def _get_config_dirs(project=None):
If a project is specified and installed from a snap package, following
directories are also returned:
- ${SNAP}/etc/${project}
${SNAP_COMMON}/etc/${project}
+ ${SNAP}/etc/${project}
Otherwise, if project is not specified, these directories are returned:
@@ -672,8 +672,8 @@ def _get_config_dirs(project=None):
_fixpath('~'),
os.path.join('/etc', project) if project else None,
'/etc',
- os.path.join(snap, "etc", project) if snap and project else None,
os.path.join(snap_c, "etc", project) if snap_c and project else None,
+ os.path.join(snap, "etc", project) if snap and project else None,
]
return [x for x in cfg_dirs if x]
@@ -724,8 +724,8 @@ def find_config_files(project=None, prog=None, extension='.conf'):
~/
/etc/${project}/
/etc/
- ${SNAP}/etc/${project}
${SNAP_COMMON}/etc/${project}
+ ${SNAP}/etc/${project}
We return an absolute path for (at most) one of each the default config
files, for the topmost directory it exists in.
@@ -756,8 +756,8 @@ def find_config_dirs(project=None, prog=None, extension='.conf.d'):
~/
/etc/${project}/
/etc/
- ${SNAP}/etc/${project}
${SNAP_COMMON}/etc/${project}
+ ${SNAP}/etc/${project}
We return an absolute path for each of the two config dirs,
in the first place we find it (iff we find it).
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']