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
This commit is contained in:
James E. Blair
2012-06-13 18:01:32 +00:00
parent 048edd7238
commit ce8a8efe4c

View File

@@ -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