From db78657c231663f3e8ebbc18de43c06ddaa94c97 Mon Sep 17 00:00:00 2001 From: James Pic Date: Wed, 2 Jun 2021 09:42:35 +0200 Subject: [PATCH] Fix _get_images_dir when pip-installed with --user There are two cases where pip installs kolla share into ~/.local/share/kolla: - with `pip install --user kolla` - with `pip install kolla` as non-root This patch helps kolla find the share dir in these cases. Closes-Bug: #1930544 Change-Id: I0b3eb6744a34a601266179fb358510a5c500e6ba --- kolla/image/build.py | 1 + releasenotes/notes/bug-1930544-a8926990f3a578a9.yaml | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 releasenotes/notes/bug-1930544-a8926990f3a578a9.yaml diff --git a/kolla/image/build.py b/kolla/image/build.py index 40cf93c3cb..0e76ac919d 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -753,6 +753,7 @@ class KollaWorker(object): PROJECT_ROOT, os.path.join(sys.prefix, 'share/kolla'), os.path.join(sys.prefix, 'local/share/kolla'), + os.path.join(os.getenv('HOME', ''), '.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/zioproto/snap-kolla diff --git a/releasenotes/notes/bug-1930544-a8926990f3a578a9.yaml b/releasenotes/notes/bug-1930544-a8926990f3a578a9.yaml new file mode 100644 index 0000000000..f10ce242af --- /dev/null +++ b/releasenotes/notes/bug-1930544-a8926990f3a578a9.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix support for kolla install in ``~/.local``. `LP#1930544 + `__