summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2017-05-30 16:30:49 -0500
committerNarinder Gupta <narinder.gupta@canonical.com>2017-05-30 23:13:32 -0500
commit9e321798fa5422c102b9a8a7d3fef799b9745d65 (patch)
tree0c052749ca07e5b96cc149756c53b259222a52aa /ci
parentd2d7586c4959bbb4db265fd8aa41519b595856db (diff)
another bug fix.
Change-Id: I4aacad242b1c9cef56cfe0c1999c27fdce3dcc0a Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/openstack.sh30
1 files changed, 28 insertions, 2 deletions
diff --git a/ci/openstack.sh b/ci/openstack.sh
index 24d068f9..4fdf1f96 100755
--- a/ci/openstack.sh
+++ b/ci/openstack.sh
@@ -92,13 +92,36 @@ create_openrc() {
adminPasswd=$(juju config keystone | grep admin-password -A 5 | grep value | awk '{print $2}' 2> /dev/null)
fi
- configOpenrc admin $adminPasswd admin http://$keystoneIp:5000/v3 RegionOne > ~/joid_config/admin-openrc
+ v3api=`juju config keystone preferred-api-version`
+
+ if [[ "$v3api" == "3" ]]; then
+ configOpenrc admin $adminPasswd admin http://$keystoneIp:5000/v3 RegionOne > ~/joid_config/admin-openrc
+ chmod 0600 ~/joid_config/admin-openrc
+ source ~/joid_config/admin-openrc
+ projectid=`openstack project show admin -c id -f value`
+ configOpenrc admin $adminPasswd admin http://$keystoneIp:5000/v3 RegionOne $projectid > ~/joid_config/admin-openrc
+ else
+ configOpenrc2 admin $adminPasswd admin http://$keystoneIp:5000/v2.0 RegionOne > ~/joid_config/admin-openrc
+ chmod 0600 ~/joid_config/admin-openrc
+ fi
+}
- chmod 0600 ~/joid_config/admin-openrc
+configOpenrc2() {
+cat <<-EOF
+export SERVICE_ENDPOINT=$4
+unset SERVICE_TOKEN
+unset SERVICE_ENDPOINT
+export OS_USERNAME=$1
+export OS_PASSWORD=$2
+export OS_TENANT_NAME=$3
+export OS_AUTH_URL=$4
+export OS_REGION_NAME=$5
+EOF
}
configOpenrc() {
cat <<-EOF
+# unsetting v3 items in case set
export OS_AUTH_URL=$4
export OS_USERNAME=$1
export OS_PASSWORD=$2
@@ -106,9 +129,12 @@ export OS_USER_DOMAIN_NAME=admin_domain
export OS_PROJECT_DOMAIN_NAME=admin_domain
export OS_PROJECT_NAME=$3
export OS_TENANT_NAME=$3
+export OS_TENANT_ID=$6
export OS_REGION_NAME=$5
export OS_IDENTITY_API_VERSION=3
# Swift needs this:
+export OS_ENDPOINT_TYPE=publicURL
+export OS_INTERFACE=public
export OS_AUTH_VERSION=3
EOF
}