Always use sudo -H when pip installing

Recent versions of pip will create ~/.cache if it doesn't already exist.

If this happens while running "sudo pip" the resulting dir will be owned
by root and 700 - which breaks anything else on the system that wants to
use ~/.cache

I *think* this finds all instances of "sudo pip" in this repo and fixes
them to use -H. This should mean they always run in the right ~

Change-Id: I47ddb3b591df6ac2100f09b38c9b8a03cb1ba1ff
closes-bug: #1405732
This commit is contained in:
James Polley 2014-12-26 10:38:54 +01:00
parent ede905d467
commit aeadb73010
7 changed files with 8 additions and 8 deletions

View File

@ -142,7 +142,7 @@
builders: builders:
- shell: | - shell: |
#!/bin/bash -xe #!/bin/bash -xe
sudo pip install ansible==1.6.10 sudo -H pip install ansible==1.6.10
- builder: - builder:
name: ansible-syntax-prep name: ansible-syntax-prep
@ -173,7 +173,7 @@
builders: builders:
- shell: | - shell: |
#!/bin/bash -xe #!/bin/bash -xe
sudo pip install ansible-lint sudo -H pip install ansible-lint
- builder: - builder:
name: ansible-lint name: ansible-lint

View File

@ -25,7 +25,7 @@
function pre_test_hook {{ function pre_test_hook {{
cd /opt/stack/new/sqlalchemy-migrate cd /opt/stack/new/sqlalchemy-migrate
sudo pip install . sudo -H pip install .
}} }}
export -f pre_test_hook export -f pre_test_hook

View File

@ -18,7 +18,7 @@ Install diskimage-builder:
:: ::
sudo pip install diskimage-builder sudo -H pip install diskimage-builder
Build an image Build an image

View File

@ -18,5 +18,5 @@
git clone /opt/git/openstack-infra/zuul /tmp/zuul git clone /opt/git/openstack-infra/zuul /tmp/zuul
sudo virtualenv /usr/zuul-env sudo virtualenv /usr/zuul-env
sudo /usr/zuul-env/bin/pip install /tmp/zuul sudo -H /usr/zuul-env/bin/pip install /tmp/zuul
sudo rm -fr /tmp/zuul sudo rm -fr /tmp/zuul

View File

@ -27,4 +27,4 @@ PIP_GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
if [ ! -f get-pip.py ] ; then if [ ! -f get-pip.py ] ; then
curl -O $PIP_GET_PIP_URL || wget $PIP_GET_PIP_URL curl -O $PIP_GET_PIP_URL || wget $PIP_GET_PIP_URL
fi fi
sudo python get-pip.py sudo -H python get-pip.py

View File

@ -154,7 +154,7 @@ sudo rm -f /etc/cron.{monthly,weekly,daily,hourly,d}/*
# to using 3.3 with virtualenv. # to using 3.3 with virtualenv.
git clone /opt/git/openstack-infra/zuul /tmp/zuul git clone /opt/git/openstack-infra/zuul /tmp/zuul
sudo virtualenv -p python2 /usr/zuul-env sudo virtualenv -p python2 /usr/zuul-env
sudo /usr/zuul-env/bin/pip install /tmp/zuul sudo -H /usr/zuul-env/bin/pip install /tmp/zuul
sudo rm -fr /tmp/zuul sudo rm -fr /tmp/zuul
sync sync

View File

@ -28,7 +28,7 @@ cd /opt/nodepool-scripts/
./install_devstack_dependencies.sh ./install_devstack_dependencies.sh
# toci scripts use both of these # toci scripts use both of these
sudo pip install gear os-apply-config sudo -H pip install gear os-apply-config
# tripleo-gate runs with two networks - the public access network and eth1 # tripleo-gate runs with two networks - the public access network and eth1
# pointing at the in-datacentre L2 network where we can talk to the test # pointing at the in-datacentre L2 network where we can talk to the test