Revert "move single host setup activities to setup_host"

This reverts commit e0df323af6.

This is necessary as the changes made in this change are not self test
able and they broke the gate. Revert for now giving us time to write a
proper fix.

Change-Id: Ifda95f159d5ae5818d2674b00824e5adead4b486
This commit is contained in:
Clark Boylan
2013-10-29 12:24:59 -07:00
parent e0df323af6
commit 31d91ddc3e

View File

@@ -46,6 +46,31 @@ function setup_workspace {
# Enabled detailed logging, since output of this function is redirected
set -o xtrace
# 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
# Hpcloud provides no swap, but does have a virtual disk mounted
# at /mnt we can use. It also doesn't have enough space on / for
# two devstack installs, so we partition the vdisk:
if [ `grep SwapTotal /proc/meminfo | awk '{ print $2; }'` -eq 0 ] && \
[ -b /dev/vdb ]; then
sudo umount /dev/vdb
sudo parted /dev/vdb --script -- mklabel msdos
sudo parted /dev/vdb --script -- mkpart primary linux-swap 0 8192
sudo parted /dev/vdb --script -- mkpart primary ext2 8192 -1
sudo mkswap /dev/vdb1
sudo mkfs.ext4 /dev/vdb2
sudo swapon /dev/vdb1
sudo mount /dev/vdb2 /opt
fi
sudo mkdir -p $DEST
sudo chown -R jenkins:jenkins $DEST
cd $DEST
@@ -142,31 +167,6 @@ function setup_host {
# Enabled detailed logging, since output of this function is redirected
set -o xtrace
# 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
# Hpcloud provides no swap, but does have a virtual disk mounted
# at /mnt we can use. It also doesn't have enough space on / for
# two devstack installs, so we partition the vdisk:
if [ `grep SwapTotal /proc/meminfo | awk '{ print $2; }'` -eq 0 ] && \
[ -b /dev/vdb ]; then
sudo umount /dev/vdb
sudo parted /dev/vdb --script -- mklabel msdos
sudo parted /dev/vdb --script -- mkpart primary linux-swap 0 8192
sudo parted /dev/vdb --script -- mkpart primary ext2 8192 -1
sudo mkswap /dev/vdb1
sudo mkfs.ext4 /dev/vdb2
sudo swapon /dev/vdb1
sudo mount /dev/vdb2 /opt
fi
# Make sure headers for the currently running kernel are installed:
sudo apt-get install -y --force-yes linux-headers-`uname -r`
@@ -491,13 +491,6 @@ if ! function_exists "gate_hook"; then
}
fi
echo "Triggered by: https://review.openstack.org/$ZUUL_CHANGE patchset $ZUUL_PATCHSET"
echo "Pipeline: $ZUUL_PIPELINE"
echo "IP configuration of this host:"
ip -f inet addr show
setup_host &> $WORKSPACE/logs/devstack-gate-setup-host.txt
if [ "$DEVSTACK_GATE_GRENADE" -eq "1" ]; then
ORIGBRANCH=$ZUUL_BRANCH
ZUUL_BRANCH=$GRENADE_OLD_BRANCH
@@ -506,6 +499,13 @@ if [ "$DEVSTACK_GATE_GRENADE" -eq "1" ]; then
ZUUL_BRANCH=$ORIGBRANCH
fi
echo "Triggered by: https://review.openstack.org/$ZUUL_CHANGE patchset $ZUUL_PATCHSET"
echo "Pipeline: $ZUUL_PIPELINE"
echo "IP configuration of this host:"
ip -f inet addr show
setup_host &> $WORKSPACE/logs/devstack-gate-setup-host.txt
# Run pre test hook if we have one
if function_exists "pre_test_hook"; then
set -o xtrace