kayobe-env: Unstick KOLLA_SOURCE_PATH and KOLLA_VENV_PATH

The kayobe-env script does not update the KOLLA_SOURCE_PATH and
KOLLA_VENV_PATH variables if they are already set.  This can lead to
dangerous and difficult to diagnose issues where Kayobe uses a different
version of Kolla Ansible than expected.

This change updates these variables each time the kayobe-env script is
sourced.

Change-Id: I3b4b0b611750b9c7846ff5f74554aee2f14939e4
Closes-Bug: #2036711
(cherry picked from commit 651b8be1a0)
This commit is contained in:
Mark Goddard 2023-09-20 09:14:17 +01:00 committed by Maksim Malchuk
parent b759386da7
commit 665a05cdaa
1 changed files with 2 additions and 2 deletions

View File

@ -30,8 +30,8 @@ export KOLLA_CONFIG_PATH=$KAYOBE_CONFIG_ROOT/etc/kolla
# kayobe/
# kolla-ansible/
base_path=$(realpath $KAYOBE_CONFIG_ROOT/../../)
export KOLLA_SOURCE_PATH=${KOLLA_SOURCE_PATH:-${base_path}/src/kolla-ansible}
export KOLLA_VENV_PATH=${KOLLA_VENV_PATH:-${base_path}/venvs/kolla-ansible}
export KOLLA_SOURCE_PATH=${base_path}/src/kolla-ansible
export KOLLA_VENV_PATH=${base_path}/venvs/kolla-ansible
function check_and_export_env {
# Look for existing Kayobe environments