From ce8a8efe4c3791f092b793711e8a0e5615e997c7 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 13 Jun 2012 18:01:32 +0000 Subject: [PATCH] Work around hpcloud hostname issue. The hostname needs to be in /etc/hosts, we can't rely on the dns server that hpcloud is using now; it breaks during nova network reconfiguration, and that breaks sudo. Change-Id: I4f0a39f5d629f1eeaf47af66528db3c63692810b --- devstack-vm-gate-wrap.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index a3741b13..839345cb 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -43,6 +43,16 @@ if [ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]; then PROJECTS="openstack/tempest $PROJECTS" fi +# HPcloud stopped adding the hostname to /etc/hosts with their +# precise images. + +HOSTNAME=`/bin/hostname` +if ! grep $HOSTNAME /etc/hosts >/dev/null +then + echo "Need to add hostname to /etc/hosts" + sudo bash -c 'echo "127.0.1.1 $HOSTNAME" >>/etc/hosts' +fi + cd $WORKSPACE ORIGINAL_GERRIT_PROJECT=GERRIT_PROJECT