Fix catalog error when finding user_id from user_name
Fix catalog error when finding user_id from user_name Change-Id: I994aae02f703186c7c15d7b86751393dc09367c4 Closes-Bug: #1459258
This commit is contained in:
parent
dab919872f
commit
4c9ff23b3b
|
@ -34,17 +34,19 @@ class TrustMiddleware(wsgi.Middleware):
|
||||||
importutils.import_module('keystonemiddleware.auth_token')
|
importutils.import_module('keystonemiddleware.auth_token')
|
||||||
admin_user = cfg.CONF.keystone_authtoken.admin_user
|
admin_user = cfg.CONF.keystone_authtoken.admin_user
|
||||||
admin_passwd = cfg.CONF.keystone_authtoken.admin_password
|
admin_passwd = cfg.CONF.keystone_authtoken.admin_password
|
||||||
|
project_name = cfg.CONF.keystone_authtoken.admin_tenant_name
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
'auth_url': ctx.auth_url,
|
'auth_url': ctx.auth_url,
|
||||||
'user_name': admin_user,
|
'user_name': admin_user,
|
||||||
'password': admin_passwd,
|
'password': admin_passwd,
|
||||||
|
'project_name': project_name,
|
||||||
# This is a hack, we need to know the domain name somehow
|
# This is a hack, we need to know the domain name somehow
|
||||||
'user_domain_name': 'Default',
|
'user_domain_name': 'Default',
|
||||||
|
'project_domain_name': 'Default',
|
||||||
}
|
}
|
||||||
|
|
||||||
kc = keystone_v3.KeystoneClient(params)
|
kc = keystone_v3.KeystoneClient(params)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
admin_id = kc.user_get_by_name(admin_user)
|
admin_id = kc.user_get_by_name(admin_user)
|
||||||
except exception.UserNotFound:
|
except exception.UserNotFound:
|
||||||
|
|
|
@ -178,6 +178,7 @@ def create_connection(ctx):
|
||||||
'auth_url': ctx.auth_url,
|
'auth_url': ctx.auth_url,
|
||||||
'domain_id': ctx.domain,
|
'domain_id': ctx.domain,
|
||||||
'project_id': ctx.project,
|
'project_id': ctx.project,
|
||||||
|
'project_name': ctx.project_name,
|
||||||
'project_domain_name': ctx.project_domain_name,
|
'project_domain_name': ctx.project_domain_name,
|
||||||
'user_domain_name': ctx.user_domain_name,
|
'user_domain_name': ctx.user_domain_name,
|
||||||
'username': ctx.user_name,
|
'username': ctx.user_name,
|
||||||
|
|
Loading…
Reference in New Issue