예제 #1
0
파일: trusts.py 프로젝트: hguemar/sahara
def delete_trust(cluster):
    if cluster.trust_id:
        keystone_client = keystone.client_for_trusts(
            CONF.os_admin_username,
            CONF.os_admin_password,
            cluster.trust_id)
        keystone_client.trusts.delete(cluster.trust_id)
예제 #2
0
def use_os_admin_auth_token(cluster):
    if cluster.trust_id:
        ctx = context.current()
        ctx.username = CONF.os_admin_username
        ctx.tenant_id = cluster.tenant_id
        client = keystone.client_for_trusts(CONF.os_admin_username,
                                            CONF.os_admin_password,
                                            cluster.trust_id)
        ctx.token = client.auth_token
        ctx.service_catalog = json.dumps(
            client.service_catalog.catalog['catalog'])
예제 #3
0
파일: trusts.py 프로젝트: hguemar/sahara
def use_os_admin_auth_token(cluster):
    if cluster.trust_id:
        ctx = context.current()
        ctx.username = CONF.os_admin_username
        ctx.tenant_id = cluster.tenant_id
        client = keystone.client_for_trusts(
            CONF.os_admin_username,
            CONF.os_admin_password,
            cluster.trust_id)
        ctx.token = client.auth_token
        ctx.service_catalog = json.dumps(
            client.service_catalog.catalog['catalog'])
예제 #4
0
def create_trust(cluster):
    client = keystone.client()

    trustee_id = keystone.client_for_trusts(CONF.os_admin_username,
                                            CONF.os_admin_password,
                                            None).user_id
    ctx = context.current()
    trust = client.trusts.create(trustor_user=client.user_id,
                                 trustee_user=trustee_id,
                                 impersonation=True,
                                 role_names=ctx.roles,
                                 project=client.tenant_id)
    conductor.cluster_update(ctx, cluster, {'trust_id': trust.id})
예제 #5
0
파일: trusts.py 프로젝트: hguemar/sahara
def create_trust(cluster):
    client = keystone.client()

    trustee_id = keystone.client_for_trusts(
        CONF.os_admin_username,
        CONF.os_admin_password,
        None).user_id
    ctx = context.current()
    trust = client.trusts.create(trustor_user=client.user_id,
                                 trustee_user=trustee_id,
                                 impersonation=True,
                                 role_names=ctx.roles,
                                 project=client.tenant_id)
    conductor.cluster_update(ctx,
                             cluster,
                             {'trust_id': trust.id})
예제 #6
0
def delete_trust(cluster):
    if cluster.trust_id:
        keystone_client = keystone.client_for_trusts(CONF.os_admin_username,
                                                     CONF.os_admin_password,
                                                     cluster.trust_id)
        keystone_client.trusts.delete(cluster.trust_id)