aboutsummaryrefslogtreecommitdiff
path: root/tests/test-octavia.sh
diff options
context:
space:
mode:
authorMichal Arbet <michal.arbet@ultimum.io>2025-05-15 01:25:31 +0200
committerMichal Arbet <michal.arbet@ultimum.io>2025-05-20 23:01:51 +0200
commit9c41becc8d499167a48aa5ae77d3e1282964ad61 (patch)
tree2489e94226f7d2be84eb29065a6e039a1358a1b6 /tests/test-octavia.sh
parentdcafed414532c88b776ebe57743c84e57e330d39 (diff)
downloadkolla-ansible-9c41becc8d499167a48aa5ae77d3e1282964ad61.tar.gz
kolla-ansible-9c41becc8d499167a48aa5ae77d3e1282964ad61.zip
Standardize Python interpreter handling
This patch ensures that the system Python interpreter is always used during the `bootstrap-servers` phase by setting `ansible_python_interpreter=auto_silent` via `extra_vars`, while the `octavia-certificates` command now explicitly uses the same Python interpreter that was used to invoke the `kolla-ansible` CLI, ensuring compatibility with the local environment. Summary: - The `ansible_python_interpreter` is now dynamically defined in `group_vars/all.yml`, falling back to the system interpreter if no virtualenv is configured. - CLI commands now detect and respect user-specified `ansible_python_interpreter` values via `-e`, and avoid overriding them. - The `bootstrap-servers` command always uses the system Python interpreter by setting `ansible_python_interpreter=auto_silent`, ensuring a clean environment for virtualenv creation. - The `octavia-certificates` command uses the Python interpreter that invoked the `kolla-ansible` CLI, ensuring compatibility with locally installed packages (e.g. cryptography). This improves interpreter handling across commands, especially in environments with custom Python setups or virtual environments. Depends-On: https://review.opendev.org/c/openstack/ansible-collection-kolla/+/949767 Change-Id: I7dc6cf8eda3b1fd48d2000f18b4670a4ef4ce1b4
Diffstat (limited to 'tests/test-octavia.sh')
-rw-r--r--tests/test-octavia.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/test-octavia.sh b/tests/test-octavia.sh
index 10f8618b8..311f18f2d 100644
--- a/tests/test-octavia.sh
+++ b/tests/test-octavia.sh
@@ -11,8 +11,7 @@ export PYTHONUNBUFFERED=1
function check_certificate_expiry {
RAW_INVENTORY=/etc/kolla/inventory
source $KOLLA_ANSIBLE_VENV_PATH/bin/activate
- # NOTE(mnasiadka): Use venv python here for cryptography package (Ansible fails otherwise)
- kolla-ansible octavia-certificates -i ${RAW_INVENTORY} --check-expiry 7 -e ansible_python_interpreter=$KOLLA_ANSIBLE_VENV_PATH/bin/python
+ kolla-ansible octavia-certificates -i ${RAW_INVENTORY} --check-expiry 7
deactivate
}