Convert resource_name to number

When sorting by resource_name, first convert it to a number so that
it's sorted correctly. Otherwise, deployments with > 10 nodes could
configure nodes out of order.

Change-Id: I604428dacd63140f4e89b45c55f7eb859df27fe7
Closes-Bug: #1768158
This commit is contained in:
James Slagle 2018-04-30 20:03:19 -04:00
parent 7952d2e53a
commit 49d0721335
2 changed files with 6 additions and 1 deletions

View File

@ -106,7 +106,7 @@ for role in $OVERCLOUD_ROLES; do
stacks=$(with_backoff fail_if_empty openstack stack resource list $rg_stack -c resource_name -c physical_resource_id -f json | jq -r "sort_by(.resource_name) | .[] | .physical_resource_id")
rc=${?}
while [ ${rc} -ne 0 ]; do
stacks=$(with_backoff fail_if_empty openstack stack resource list $rg_stack -c resource_name -c physical_resource_id -f json | jq -r "sort_by(.resource_name) | .[] | .physical_resource_id")
stacks=$(with_backoff fail_if_empty openstack stack resource list $rg_stack -c resource_name -c physical_resource_id -f json | jq -r "sort_by(.resource_name | tonumber) | .[] | .physical_resource_id")
done
i=0

View File

@ -0,0 +1,5 @@
---
fixes:
- Previously, get-occ-config.sh could configure nodes out of order when
deploying with more than 10 nodes. The script has been updated to properly
sort the node resource names by first converting the names to a number.