From 746e72d4c3494b9765c2ba221c50f0ca20128c29 Mon Sep 17 00:00:00 2001 From: Mark Hamzy Date: Wed, 14 Oct 2015 13:42:18 -0500 Subject: [PATCH] Restrict requests to fedora The os_RELEASE for RHEL is 7.1 (for example). Which does not work for comparisons to an integer. And, while I am at it, change base_path to not use a hard-coded directory. Change-Id: I64a04810cc7ba4668c2cb7a8df79c206301e9e16 --- tools/fixup_stuff.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/fixup_stuff.sh b/tools/fixup_stuff.sh index a601cf2f67..b57d140d6d 100755 --- a/tools/fixup_stuff.sh +++ b/tools/fixup_stuff.sh @@ -135,7 +135,7 @@ if is_fedora; then fi fi - if [[ "$os_RELEASE" -ge "21" ]]; then + if [[ "$os_VENDOR" == "Fedora" ]] && [[ "$os_RELEASE" -ge "21" ]]; then # requests ships vendored version of chardet/urllib3, but on # fedora these are symlinked back to the primary versions to # avoid duplication of code on disk. This is fine when @@ -152,9 +152,9 @@ if is_fedora; then # https://bugs.launchpad.net/glance/+bug/1476770 # https://bugzilla.redhat.com/show_bug.cgi?id=1253823 - base_path=/usr/lib/python2.7/site-packages/requests/packages + base_path=$(get_package_path requests)/packages if [ -L $base_path/chardet -o -L $base_path/urllib3 ]; then - sudo rm -f /usr/lib/python2.7/site-packages/requests/packages/{chardet,urllib3} + sudo rm -f $base_path/{chardet,urllib3} # install requests with the bundled urllib3 to avoid conflicts pip_install --upgrade --force-reinstall requests fi