]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat-keystone-setup : fix error on folsom first-install
authorSteven Hardy <shardy@redhat.com>
Wed, 31 Oct 2012 16:28:19 +0000 (16:28 +0000)
committerSteven Hardy <shardy@redhat.com>
Wed, 31 Oct 2012 16:28:19 +0000 (16:28 +0000)
When running heat-keystone-setup for the first time after (re)installing
openstack folsom, it fails, because the user-role-list is running *as* the
heat user, not reading the roles assigned to the heat user, which fails
because on a new install the heat user does not have the admin role.
Using the credentials from the environment means we run the command as
admin, but --user_id selects the roles for the heat user.

Change-Id: Ib2733e63f664d75be1e2e3bd43038bbd1dbebde8
Signed-off-by: Steven Hardy <shardy@redhat.com>
bin/heat-keystone-setup

index 9c8669b63c80f91ffb250633326f58fb9d305573..9e6394b9764d6239bf73def502849cdc8a00c93d 100755 (executable)
@@ -83,9 +83,9 @@ add_role() {
     # option "user-role-list" to detect we're on that newer version
     # This also allows us to detect when the user already has the
     # requested role_id, preventing an error on folsom
-    user_roles=$(keystone --os-username $username\
-                          --os-tenant-id $tenant\
-                          user-role-list 2>/dev/null)
+    user_roles=$(keystone user-role-list \
+                          --user_id $user_id\
+                          --tenant_id $tenant 2>/dev/null)
     if [ $? == 0 ]; then
         # Folsom
         existing_role=$(get_data 1 $role_id 1 echo "$user_roles")