From c9596b72a1efd9733361081029f2dc0e194d0b6d Mon Sep 17 00:00:00 2001 From: James Slagle Date: Sun, 8 Jan 2017 16:21:51 -0500 Subject: [PATCH] Continue checking for request url if initially null When using get-occ-config.sh during overcloud upgrades, the script could potentially be started before the stack has been upgraded. In that scenario, the script will return null for the request metadata url for the deployed-server resource since the stack has not yet been updated and it's still using the previous Heat signaling. This patch updates the script to just continue checking the resource metadata if the request url is null. Eventually, once the resource has been updated, the script will continue and properly populate the os-collect-config configuration. Change-Id: I9db54d8ad278715f42b768edf8f0fd21998b2098 --- deployed-server/scripts/get-occ-config.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deployed-server/scripts/get-occ-config.sh b/deployed-server/scripts/get-occ-config.sh index 404244b14b..6c196f972d 100755 --- a/deployed-server/scripts/get-occ-config.sh +++ b/deployed-server/scripts/get-occ-config.sh @@ -79,7 +79,14 @@ for role in $OVERCLOUD_ROLES; do server_stack=$(openstack stack resource show $stack $server_resource_name -c physical_resource_id -f value) done - deployed_server_metadata_url=$(openstack stack resource metadata $server_stack deployed-server | jq -r '.["os-collect-config"].request.metadata_url') + while true; do + deployed_server_metadata_url=$(openstack stack resource metadata $server_stack deployed-server | jq -r '.["os-collect-config"].request.metadata_url') + if [ "$deployed_server_metadata_url" = "null" ]; then + continue + else + break + fi + done echo "======================" echo "$role$i os-collect-config.conf configuration:"