Prefer SNAP_COMMON configuration files.

Ensure that any config files in $SNAP_COMMON are preferred over those
in $SNAP (cherry pick if inflight fix to oslo.config).
This commit is contained in:
James Page 2017-10-05 10:39:44 +01:00
parent 288b501f7f
commit 3860edc172
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,18 @@
Description: Ensure that SNAP_COMMON is used in preference to $SNAP
Author: James Page <james.page@ubuntu.com>
Forwarded: https://review.openstack.org/509724
diff --git a/oslo_config/cfg.py b/oslo_config/cfg.py
index cbdcdfa..9365956 100644
--- a/oslo_config/cfg.py
+++ b/oslo_config/cfg.py
@@ -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]

View File

@ -64,6 +64,10 @@ parts:
- python-rados
install: |
touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/paste/__init__.py
touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/repoze/__init__.py
export SNAP_ROOT="../../../"
export SNAP_SITE_PACKAGES="$SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages"
patch -d $SNAP_SITE_PACKAGES -p1 < $SNAP_ROOT/patches/oslo-config-prefer-snap-common.patch
templates:
after: [gnocchi]
plugin: dump