Skip to content

Commit 77d0509

Browse files
markgoddardyoctozepto
authored andcommitted
Fix installation with pip install --user
If kolla-ansible is installed via pip install --user, currently the kolla-ansible script is unable to locate the installed playbooks. This leads to a failure when running commands. This change fixes the issue by checking for the user's .local directory as a possible installation path. This fixes some of the scenario tests which were failing after switching to a user installation in Ifaf1948ed5d42eebaa62d7bad375bbfc12b134d5. Most tests did not fail since the kolla-ansible script in the source checkout was used. Closes-Bug: #1915527 Change-Id: I5b47a146627d06bb3fe4a747c5f20290c726b0f9 (cherry picked from commit 519ca1c)
1 parent c4f6ca1 commit 77d0509

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes an issue with executing ``kolla-ansible`` when installed via ``pip
5+
install --user``. `LP#1915527
6+
<https://bugs.launchpad.net/kolla-ansible/+bug/1915527>`__

tools/kolla-ansible

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ function find_base_dir {
7575
BASEDIR=/usr/share/kolla-ansible
7676
elif [[ ${dir_name} == "/usr/local/bin" ]]; then
7777
BASEDIR=/usr/local/share/kolla-ansible
78+
elif [[ ${dir_name} == ~/.local/bin ]]; then
79+
BASEDIR=~/.local/share/kolla-ansible
7880
elif [[ -n ${VIRTUAL_ENV} ]] && [[ ${dir_name} == "$(readlink -e "${VIRTUAL_ENV}/bin")" ]]; then
7981
if test -f ${VIRTUAL_ENV}/lib/python*/site-packages/kolla-ansible.egg-link; then
8082
# Editable install.

0 commit comments

Comments
 (0)