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 check_cinder_exists(): services = [service.name for service in keystone.client().services.list()] if 'cinder' not in services: raise ex.InvalidException("Cinder is not supported")
def check_cinder_exists(): services = [service.name for service in keystone.client().services.list()] if 'cinder' not in services: raise ex.InvalidException("Cinder is not supported")