heat-keystone-setup : fix error on folsom first-install

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>
This commit is contained in:
Steven Hardy 2012-10-31 16:28:19 +00:00
parent 0ba94dcc7a
commit e0bb98d4f5
1 changed files with 3 additions and 3 deletions

View File

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