Example #1
0
def create_trust():
    client = keystone.client()

    ctx = auth_ctx.ctx()

    trustee_id = keystone.client_for_admin().session.get_user_id()

    return client.trusts.create(trustor_user=client.user_id,
                                trustee_user=trustee_id,
                                impersonation=True,
                                role_names=ctx.roles,
                                project=ctx.project_id)
Example #2
0
def create_trust():
    client = keystone.client()

    ctx = auth_ctx.ctx()

    trustee_id = keystone.client_for_admin(
        CONF.keystone_authtoken.admin_tenant_name).user_id

    return client.trusts.create(trustor_user=client.user_id,
                                trustee_user=trustee_id,
                                impersonation=True,
                                role_names=ctx.roles,
                                project=ctx.project_id)
Example #3
0
def create_trust():
    client = keystone.client()

    ctx = auth_ctx.ctx()

    trustee_id = keystone.client_for_admin().session.get_user_id()

    return client.trusts.create(
        trustor_user=client.user_id,
        trustee_user=trustee_id,
        impersonation=True,
        role_names=ctx.roles,
        project=ctx.project_id
    )
Example #4
0
def create_trust():
    client = keystone.client()

    ctx = auth_ctx.ctx()

    trustee_id = keystone.client_for_admin(
        CONF.keystone_authtoken.admin_tenant_name).user_id

    return client.trusts.create(
        trustor_user=client.user_id,
        trustee_user=trustee_id,
        impersonation=True,
        role_names=ctx.roles,
        project=ctx.project_id
    )
Example #5
0
def create_trust(workbook):
    client = keystone.client()

    ctx = context.ctx()

    trustee_id = keystone.client_for_admin(ctx['project_id']).user_id

    trust = client.trusts.create(trustor_user=client.user_id,
                                 trustee_user=trustee_id,
                                 impersonation=True,
                                 role_names=ctx['roles'],
                                 project=ctx['project_id'])

    return db_api.workbook_update(workbook['name'],
                                  {'trust_id': trust.id,
                                   'project_id': ctx['project_id']})
Example #6
0
def create_trust(workbook):
    client = keystone.client()

    ctx = context.ctx()

    trustee_id = keystone.client_for_admin(
        CONF.keystone_authtoken.admin_tenant_name).user_id

    trust = client.trusts.create(trustor_user=client.user_id,
                                 trustee_user=trustee_id,
                                 impersonation=True,
                                 role_names=ctx.roles,
                                 project=ctx.project_id)

    return db_api.workbook_update(workbook['name'],
                                  {'trust_id': trust.id,
                                   'project_id': ctx.project_id})
Example #7
0
def create_trust(workbook):
    client = keystone.client()

    ctx = context.ctx()

    trustee_id = keystone.client_for_admin(ctx['project_id']).user_id

    trust = client.trusts.create(trustor_user=client.user_id,
                                 trustee_user=trustee_id,
                                 impersonation=True,
                                 role_names=ctx['roles'],
                                 project=ctx['project_id'])

    return db_api.workbook_update(workbook['name'], {
        'trust_id': trust.id,
        'project_id': ctx['project_id']
    })