From daded8d4d6e737c6d2cd486b6ee0a0130baa5946 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 23 Dec 2013 21:07:59 -0800 Subject: [PATCH] Fix copying of select-mirror outputs. The Jenkins user was attempting to write to ~stack and failing because it does not have permission to do so. Use more sudo to get around that. Additionally move the fix for /etc/hosts into setup_host instead of setup_workspace. This will make the use of sudo quieter as it will be able to resolve $HOSTNAME earlier. Change-Id: I8e6bd821ceac9d0614c068dc7ce7a6657329d84c --- devstack-vm-gate-wrap.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index c88797e3..b2c718b5 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -172,8 +172,6 @@ function setup_workspace { # Enabled detailed logging, since output of this function is redirected set -o xtrace - fix_etc_hosts - fix_disk_layout sudo mkdir -p $DEST @@ -211,17 +209,19 @@ function select_mirror { SHORT_PROJECT=$(basename $ZUUL_PROJECT) $DEVSTACK_GATE_SELECT_MIRROR $ORG $SHORT_PROJECT - cp ~/.pydistutils.cfg ~stack/.pydistutils.cfg sudo cp ~/.pydistutils.cfg ~root/.pydistutils.cfg + sudo cp ~/.pydistutils.cfg ~stack/.pydistutils.cfg + sudo chown stack:stack ~stack/.pydistutils.cfg sudo cp ~/.pydistutils.cfg ~tempest/.pydistutils.cfg sudo chown tempest:tempest ~tempest/.pydistutils.cfg - mkdir -p ~stack/.pip + sudo -u stack mkdir -p ~stack/.pip sudo -u root mkdir -p ~root/.pip sudo -u tempest mkdir -p ~tempest/.pip - cp ~/.pip/pip.conf ~stack/.pip/pip.conf sudo -u root cp ~/.pip/pip.conf ~root/.pip/pip.conf + sudo cp ~/.pip/pip.conf ~stack/.pip/pip.conf + sudo chown stack:stack ~stack/.pip/pip.conf sudo cp ~/.pip/pip.conf ~tempest/.pip/pip.conf sudo chown tempest:tempest ~tempest/.pip/pip.conf fi @@ -231,6 +231,9 @@ function setup_host { # Enabled detailed logging, since output of this function is redirected set -o xtrace + # This is necessary to keep sudo from complaining + fix_etc_hosts + # Move the PIP cache into position: sudo mkdir -p /var/cache/pip sudo mv ~/cache/pip/* /var/cache/pip