Create trusts for admin user with correct tenant name

See the bug description for details.

Closes-Bug: 1318706
Change-Id: Iaed2b9f2ff8964df3d2c5753dcfaf2688046828c
This commit is contained in:
Dmitry Mescheryakov 2014-05-12 19:23:28 +04:00 committed by Sergey Lukjanov
parent bd46ba2508
commit af48075d1f
2 changed files with 5 additions and 5 deletions

View File

@ -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,

View File

@ -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):