From: James Slagle Date: Thu, 16 Feb 2017 21:19:23 +0000 (-0500) Subject: Sort ResourceGroup resource list X-Git-Tag: opnfv-6.0.0~868^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=c5e5d21a61808f7c09b85a2750a905bb57b54be1;p=apex-tripleo-heat-templates.git Sort ResourceGroup resource list We should sort the results by resource_name when listing resources in the ResourceGroup stack in get-occ-config.sh, as the order is not guaranteed. We want the order to always be numerical ascending by resource_name (which are just integers starting at 0). Change-Id: Iccef81e4dfd9586e0030f20bdde131d1a885eb19 Closes-Bug: #1665458 --- diff --git a/deployed-server/scripts/get-occ-config.sh b/deployed-server/scripts/get-occ-config.sh index 6c196f97..d0cc4dff 100755 --- a/deployed-server/scripts/get-occ-config.sh +++ b/deployed-server/scripts/get-occ-config.sh @@ -63,7 +63,7 @@ for role in $OVERCLOUD_ROLES; do rg_stack=$(openstack stack resource show overcloud $role -c physical_resource_id -f value) done - stacks=$(openstack stack resource list $rg_stack -c physical_resource_id -f value) + stacks=$(openstack stack resource list $rg_stack -c resource_name -c physical_resource_id -f json | jq -r "sort_by(.resource_name) | .[] | .physical_resource_id") i=0