Ejemplo n.º 1
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)
Ejemplo n.º 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'])
Ejemplo n.º 3
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'])
Ejemplo n.º 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})
Ejemplo n.º 5
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})
Ejemplo n.º 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)