Fix OSA_VERSION during upgrades
Installing OSA in editable mode no longer produce egg-info and wheels,
which results in existance of stale egg-info which returns an old
version for openstack-ansible package.
As we do `cd ${OSA_CLONE_DIR}` this is appended to PATH, making
`importlib` to respect stale egg-info rather then actually installed
version from venv.
On top of that we add a simple pyproject.toml to define the build
backend of pbr to detect package versioning correctly during
installation, as otherwise behavior may be unexpected [1] due to
deprecation.
[1] https://github.com/pypa/pip/issues/11457
Closes-Bug: #2137630
Change-Id: I33c4cd030985a360570202b78e9d6f23f72edbb0
Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
This commit is contained in:
committed by
Dmitriy Chubinidze
parent
62cc0fc484
commit
17b31bf510
3
pyproject.toml
Normal file
3
pyproject.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[build-system]
|
||||
requires = ["pbr>=6.1.1"]
|
||||
build-backend = "pbr.build"
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
OpenStack-Ansible and venv version detection is fixed for environments
|
||||
which were upgraded from pre-Flamingo releases.
|
||||
@@ -135,7 +135,7 @@ if [ "${SETUP_ARA}" == "true" ]; then
|
||||
fi
|
||||
|
||||
# Get current code version (this runs at the root of OSA clone)
|
||||
export CURRENT_OSA_VERSION=$(cd ${OSA_CLONE_DIR}; /opt/ansible-runtime/bin/python -c "from importlib.metadata import version; print(version('openstack-ansible'))")
|
||||
export CURRENT_OSA_VERSION=$(cd /tmp; /opt/ansible-runtime/bin/python -c "from importlib.metadata import version; print(version('openstack-ansible'))")
|
||||
|
||||
# Ensure that Ansible binaries run from the venv
|
||||
pushd /opt/ansible-runtime/bin
|
||||
|
||||
Reference in New Issue
Block a user