From 336390f9b3691914f8aaf7a87867036fae35d8ba Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Fri, 1 Apr 2016 10:53:13 +0200 Subject: [PATCH] Set user/project domain ID when using keystone v3 Change I24546f02067ea23d088d383b85e3a78d7b43f165 aimed to use keystone v3 as default in devstack. The change was later reverted in Ia792b23119c00089542ba08879dca1c29dc80945 because it broke some projects. This patch contains a small portion of the first change to set the environment variables $OS_USER_DOMAIN_ID and $OS_PROJECT_DOMAIN_ID in openrc, so that users don't have to set them manually when using keystone v3. Change-Id: Ie4c316d60590d55830d417f13817298dac70864f Partially-Implements: bp keystonev3 Closes-Bug: 1387814 --- openrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openrc b/openrc index db2e97d3b1..8d8ae8b030 100644 --- a/openrc +++ b/openrc @@ -90,6 +90,13 @@ export OS_IDENTITY_API_VERSION=${IDENTITY_API_VERSION:-2.0} # export OS_AUTH_URL=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:5000/v${OS_IDENTITY_API_VERSION} +# Currently, in order to use openstackclient with Identity API v3, +# we need to set the domain which the user and project belong to. +if [ "$OS_IDENTITY_API_VERSION" = "3" ]; then + export OS_USER_DOMAIN_ID=${OS_USER_DOMAIN_ID:-"default"} + export OS_PROJECT_DOMAIN_ID=${OS_PROJECT_DOMAIN_ID:-"default"} +fi + # Set OS_CACERT to a default CA certificate chain if it exists. if [[ ! -v OS_CACERT ]] ; then DEFAULT_OS_CACERT=$INT_CA_DIR/ca-chain.pem