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)
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'])
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'])
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})
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})
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)