Commit e48f0660 authored by David Johnson's avatar David Johnson

Fix some problems with creating user keys for keystone v2.

parent ca1b5647
......@@ -49,8 +49,11 @@ if [ $GENIUSER -eq 1 ] ; then
AAID=`openstack user show adminapi | awk '/ id / { print $4 }'`
AID=`openstack user show admin | awk '/ id / { print $4 }'`
fi
# Do this for both the nova and nova_api DBs; that has changed over time.
echo "update key_pairs set user_id='$AID' where user_id='$AAID'" \
| mysql -u root --password=${DB_ROOT_PASS} nova
echo "update key_pairs set user_id='$AID' where user_id='$AAID'" \
| mysql -u root --password=${DB_ROOT_PASS} nova_api
# Ok, do it again!
echo "*** Importing GENI user keys, for ${ADMIN_API} user..."
......
......@@ -75,6 +75,7 @@ if rval:
def build_keystone_args():
global KEYSTONE_OPTS, CLOUDLAB_AUTH_FILE
version = None
ret = dict()
# First, see if they're in the env:
......@@ -94,6 +95,8 @@ def build_keystone_args():
vva = line.split('=')
if not vva or len(vva) != 2:
continue
if vva[0] == 'OS_IDENTITY_API_VERSION':
version = eval(vva[1])
if not vva[0] in KEYSTONE_OPTS:
continue
......@@ -110,9 +113,13 @@ def build_keystone_args():
LOG.warn("%s does not exist; not loading auth opts from it",CLOUDLAB_AUTH_FILE)
pass
# A hack for v3, because of how we write the admin-openrc.py file
# A hack for v3 (and v2), because of how we write the admin-openrc.py file.
# only project_name is valid in v3.Password; only tenant_name in v2.Password.
if 'project_name' in ret and 'tenant_name' in ret:
del ret['tenant_name']
if version is not None and version == 2.0:
del ret['project_name']
else:
del ret['tenant_name']
pass
return ret
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment