Skip to content

Commit

Permalink
Fix wait_for_compute to work for modified compute host name
Browse files Browse the repository at this point in the history
When we change the name of compute host then devstack is breaking
because it is using default host name from host.

How to change compute host name in local.conf
[[post-config|$NOVA_CONF]]
[DEFAULT]
host = foo

Change-Id: I4d4392f1f58f0431b10764610668565af88d392f
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
  • Loading branch information
pranjank committed Jul 2, 2018
1 parent 5ebfe6d commit 6f38cf4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion functions
Expand Up @@ -441,7 +441,12 @@ EOF
function wait_for_compute {
local timeout=$1
local rval=0
local compute_hostname
time_start "wait_for_service"
compute_hostname=$(iniget $NOVA_CONF DEFAULT host)
if [[ -z $compute_hostname ]]; then
compute_hostname=$(hostname)
fi
timeout $timeout bash -x <<EOF || rval=$?
ID=""
while [[ "\$ID" == "" ]]; do
Expand All @@ -450,7 +455,7 @@ function wait_for_compute {
# When using the fake driver the compute hostnames have a suffix of 1 to NUMBER_FAKE_NOVA_COMPUTE
ID=\$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" compute service list --host `hostname`1 --service nova-compute -c ID -f value)
else
ID=\$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" compute service list --host `hostname` --service nova-compute -c ID -f value)
ID=\$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" compute service list --host "$compute_hostname" --service nova-compute -c ID -f value)
fi
done
EOF
Expand Down

0 comments on commit 6f38cf4

Please sign in to comment.