Merge "Create trusts for admin user with correct tenant name"
This commit is contained in:
commit
38ddebe24b
@ -31,7 +31,7 @@ def create_trust(cluster):
|
||||
|
||||
ctx = context.current()
|
||||
|
||||
trustee_id = keystone.client_for_admin(ctx.tenant_id).user_id
|
||||
trustee_id = keystone.client_for_admin().user_id
|
||||
|
||||
trust = client.trusts.create(trustor_user=client.user_id,
|
||||
trustee_user=trustee_id,
|
||||
|
@ -52,7 +52,7 @@ def client():
|
||||
return keystone
|
||||
|
||||
|
||||
def _admin_client(tenant_id=None, trust_id=None):
|
||||
def _admin_client(project_name=None, trust_id=None):
|
||||
if not CONF.use_identity_api_v3:
|
||||
raise Exception('Trusts aren\'t implemented in keystone api'
|
||||
' less than v3')
|
||||
@ -60,15 +60,15 @@ def _admin_client(tenant_id=None, trust_id=None):
|
||||
auth_url = base.retrieve_auth_url()
|
||||
keystone = keystone_client_v3.Client(username=CONF.os_admin_username,
|
||||
password=CONF.os_admin_password,
|
||||
tenant_id=tenant_id,
|
||||
project_name=project_name,
|
||||
auth_url=auth_url,
|
||||
trust_id=trust_id)
|
||||
keystone.management_url = auth_url
|
||||
return keystone
|
||||
|
||||
|
||||
def client_for_admin(tenant_id):
|
||||
return _admin_client(tenant_id=tenant_id)
|
||||
def client_for_admin():
|
||||
return _admin_client(project_name=CONF.os_admin_tenant_name)
|
||||
|
||||
|
||||
def client_for_trusts(trust_id):
|
||||
|
Loading…
Reference in New Issue
Block a user