Fixes problem with distutils installed packages on Centos and Suse

Centos and (Open)Suse use distutils to install python packages.  Since
version 10 pip will not remove them - and therefore cannot be used to
update those packages.
Implemented is a workaround which is taken from the diskimage-builder.

Change-Id: I2ecfbb00ba6034c3b09aa83a66cd99c85b463fff
Story: 2005899
Task: 33761
Signed-off-by: Andreas Florath <Andreas.Florath@telekom.de>
This commit is contained in:
Andreas Florath 2019-06-18 10:22:43 +00:00 committed by Rico Lin
parent a850449c41
commit d9b19159c0
1 changed files with 27 additions and 0 deletions

View File

@ -1,4 +1,31 @@
#!/bin/bash
set -eux
# For centos and suse there is the need to get rid
# of the distutils installed files from some packages.
# Detailed explanation: see diskimage-builder
# diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip
PACKAGES_TO_BE_CLEARED="PyYAML python-ipaddress"
clear_old_files=0
case "$DISTRO_NAME" in
centos*|rhel*)
clear_old_files=1
;;
opensuse)
case "$DIB_RELEASE" in
42*)
clear_old_files=1
;;
esac
;;
esac
if [[ ${clear_old_files} -eq 1 ]]; then
for pkg in ${PACKAGES_TO_BE_CLEARED}; do
rpm -ql $pkg | xargs rm -rf
done
fi
pip install python-heatclient python-zaqarclient python-keystoneclient