From ad623a7e86ed5df512b9b914eb428f7331025854 Mon Sep 17 00:00:00 2001
From: Clark Boylan <clark.boylan@gmail.com>
Date: Thu, 12 Feb 2015 16:47:05 -0800
Subject: [PATCH] Use sudo when editing /etc/pip.conf

Unlike before where the jenkins user was editing files that it owns in
its homedir the /etc/pip.conf editing needs root permissions since that
file is owned by root.

Change-Id: I485a08cb243cc0abf4c848e6061606b4320a59cb
---
 nodepool/scripts/configure_mirror.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nodepool/scripts/configure_mirror.sh b/nodepool/scripts/configure_mirror.sh
index f1d822313c..4d6f7dc6f7 100755
--- a/nodepool/scripts/configure_mirror.sh
+++ b/nodepool/scripts/configure_mirror.sh
@@ -20,7 +20,7 @@ source /etc/nodepool/provider
 
 NODEPOOL_PYPI_MIRROR=${NODEPOOL_PYPI_MIRROR:-http://pypi.$NODEPOOL_REGION.openstack.org/simple}
 
-sed -i -e "s,^index-url = .*,index-url = $NODEPOOL_PYPI_MIRROR," /etc/pip.conf
+sudo sed -i -e "s,^index-url = .*,index-url = $NODEPOOL_PYPI_MIRROR," /etc/pip.conf
 
 cat >/home/jenkins/.pydistutils.cfg <<EOF
 [easy_install]