Browse code

Install prettytable>=0.7 to satisfy pip 6/PEP 440

Also use sudo -H with pip so that it doesn't create a ~stack/.cache
other things can't write to as the stack user later.

Change-Id: I2134c7d8f58f8b83f33150c9ed86d87f8ccba2f3
(cherry picked from commit 1a89f8cdf4791350a9aacb41037ab3bdcc9ecc9f)

Jeremy Stanley authored on 2014/12/23 02:17:51
Showing 3 changed files
... ...
@@ -1543,7 +1543,7 @@ function pip_install {
1543 1543
         local sudo_pip="env"
1544 1544
     else
1545 1545
         local cmd_pip=$(get_pip_command)
1546
-        local sudo_pip="sudo"
1546
+        local sudo_pip="sudo -H"
1547 1547
     fi
1548 1548
 
1549 1549
     # Mirror option not needed anymore because pypi has CDN available,
... ...
@@ -215,7 +215,7 @@ fi
215 215
 # image was created (fix in the works).  Remove all pip packages
216 216
 # before we do anything else
217 217
 if [[ $DISTRO = "rhel7" && is_rackspace ]]; then
218
-    (sudo pip freeze | xargs sudo pip uninstall -y) || true
218
+    (sudo -H pip freeze | xargs sudo -H pip uninstall -y) || true
219 219
 fi
220 220
 
221 221
 # Some distros need to add repos beyond the defaults provided by the vendor
... ...
@@ -79,7 +79,7 @@ function get_package_path {
79 79
 
80 80
 # Fix prettytable 0.7.2 permissions
81 81
 # Don't specify --upgrade so we use the existing package if present
82
-pip_install 'prettytable>0.7'
82
+pip_install 'prettytable>=0.7'
83 83
 PACKAGE_DIR=$(get_package_path prettytable)
84 84
 # Only fix version 0.7.2
85 85
 dir=$(echo $PACKAGE_DIR/prettytable-0.7.2*)