Correct shyaml installation on fedora28

Fixed failure to install a working version of shyaml on fedora28 where
shyaml was installed but not functioning because python3-yaml was
not installed.

Also fix problem that caused installation of python2 packages on
python3 systems due to the wildcards, we removed the wildcards.

Also removed single quoates from exclude param because bash did
escape them, which probably caused the excludes to be ignored.

See http://logs.openstack.org/16/614516/2/check/tripleo-ci-fedora-28-standalone/7b10b3a/job-output.txt.gz#_2018-11-01_15_05_51_598966

File "/usr/bin/shyaml", line 11, in <module>
import yaml
ModuleNotFoundError: No module named 'yaml'

Depends-On: https://review.openstack.org/#/c/614762

Change-Id: I0ffe2af9bc56d4185e2ad16dd1800bf028070414
This commit is contained in:
Sorin Sbarnea 2018-11-01 22:31:27 +00:00
parent a6fcd2f7c2
commit de8f1941a1
2 changed files with 7 additions and 3 deletions

View File

@ -216,8 +216,8 @@ function python_cmd() {
function package_manager() {
PKG="$(command -v dnf || command -v yum)"
if [ "$(python_cmd)" == "python3" ]; then
echo "${PKG} -y --exclude='python2*' $*"
echo "${PKG} -y --exclude=python2* $*"
else
echo "${PKG} -y --exclude='python3*' $*"
echo "${PKG} -y --exclude=python3* $*"
fi
}

View File

@ -45,7 +45,11 @@ cat $TRIPLEO_ROOT/tripleo-ci/scripts/fake_fail_subunit | gzip - > $WORKSPACE/log
$(python_cmd) -m pip --version || \
(curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"; sudo $(python_cmd) get-pip.py)
sudo $(package_manager) install python*-requests python*-urllib3 shyaml
if [ "$(python_cmd)" == "python3" ]; then
sudo $(package_manager) install python3-requests python3-urllib3 python3-PyYAML shyaml
else
sudo $(package_manager) install python2-requests python-requests python-urllib3 PyYAML
fi
# shyaml may not have a rpm on older distros
which shyaml 2>/dev/null || \
sudo $(python_cmd) -m pip install shyaml