Add SNAP support when finding Docker images folder

Closes-bug: #1665265

Change-Id: I046a93de72666eae11cb88eb4577c97935f72520
This commit is contained in:
Saverio Proto 2017-01-31 10:49:06 +01:00
parent 40130b2e7a
commit 8793efcc16

View File

@ -539,7 +539,12 @@ class KollaWorker(object):
possible_paths = (
PROJECT_ROOT,
os.path.join(sys.prefix, 'share/kolla'),
os.path.join(sys.prefix, 'local/share/kolla'))
os.path.join(sys.prefix, 'local/share/kolla'),
# NOTE(zioproto): When Kolla is used within a snap, the env var
# $SNAP is the directory where the snap is mounted.
# https://github.com/openstack/snap-kolla
# More info in snap packages https://snapcraft.io
os.path.join(os.environ.get('SNAP', ''), 'share/kolla'))
for path in possible_paths:
image_path = os.path.join(path, 'docker')