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
(cherry picked from commit 746e72d4c3494b9765c2ba221c50f0ca20128c29)
| ... | ... |
@@ -135,7 +135,7 @@ if is_fedora; then |
| 135 | 135 |
fi |
| 136 | 136 |
fi |
| 137 | 137 |
|
| 138 |
- if [[ "$os_RELEASE" -ge "21" ]]; then |
|
| 138 |
+ if [[ "$os_VENDOR" == "Fedora" ]] && [[ "$os_RELEASE" -ge "21" ]]; then |
|
| 139 | 139 |
# requests ships vendored version of chardet/urllib3, but on |
| 140 | 140 |
# fedora these are symlinked back to the primary versions to |
| 141 | 141 |
# avoid duplication of code on disk. This is fine when |
| ... | ... |
@@ -152,9 +152,9 @@ if is_fedora; then |
| 152 | 152 |
# https://bugs.launchpad.net/glance/+bug/1476770 |
| 153 | 153 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1253823 |
| 154 | 154 |
|
| 155 |
- base_path=/usr/lib/python2.7/site-packages/requests/packages |
|
| 155 |
+ base_path=$(get_package_path requests)/packages |
|
| 156 | 156 |
if [ -L $base_path/chardet -o -L $base_path/urllib3 ]; then |
| 157 |
- sudo rm -f /usr/lib/python2.7/site-packages/requests/packages/{chardet,urllib3}
|
|
| 157 |
+ sudo rm -f $base_path/{chardet,urllib3}
|
|
| 158 | 158 |
# install requests with the bundled urllib3 to avoid conflicts |
| 159 | 159 |
pip_install --upgrade --force-reinstall requests |
| 160 | 160 |
fi |