]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Make heat-keystone-service a tad more robust
authorTomas Sedovic <tomas@sedovic.cz>
Fri, 8 Jun 2012 09:24:04 +0000 (11:24 +0200)
committerTomas Sedovic <tomas@sedovic.cz>
Fri, 8 Jun 2012 09:24:04 +0000 (11:24 +0200)
The ADMIN_ROLE extraction failed when the column with the role names was
centered instead of left-aligned.

Change-Id: If39292b65dfce5fa820396e49e72fc635c2cb0c2

tools/heat-keystone-service

index 24075387a733e3c639862bb73f27f6b256a9597c..53319a0ed27cf3616a09fcdf0ffc4db86a995b94 100755 (executable)
@@ -22,7 +22,7 @@ if [[ -z "$SERVICE_TOKEN" ]]; then
     exit 1
 fi
 
-ADMIN_ROLE=$(keystone role-list | awk -F\| '($3 ~ "^ admin *$") { print $2 }')
+ADMIN_ROLE=$(keystone role-list | grep '\badmin\b' | awk '{ print $2 }')
 SERVICE_TENANT=$(keystone tenant-list | grep service | cut -d\| -f2)
 SERVICE_PASSWORD=${SERVICE_PASSWORD:-$OS_PASSWORD}
 if [[ "$SERVICE_PASSWORD" == "$OS_PASSWORD" ]]; then