From b525dd9be35d62911fdace59b332fd17eaf8d833 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Mon, 25 Jun 2018 22:22:17 -0500 Subject: [PATCH] Glance: Update storage init job to use internal endpoint by default This PS updates the glance storage init job to use the internal endpoint by default. Change-Id: Id85946fbe3b897a45d671b972621f94ff9173e17 Signed-off-by: Pete Birley --- glance/templates/bin/_storage-init.sh.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glance/templates/bin/_storage-init.sh.tpl b/glance/templates/bin/_storage-init.sh.tpl index 1ca016e14c..4f978b2e68 100644 --- a/glance/templates/bin/_storage-init.sh.tpl +++ b/glance/templates/bin/_storage-init.sh.tpl @@ -30,9 +30,10 @@ set -ex if [ "x$STORAGE_BACKEND" == "xpvc" ]; then echo "No action required." elif [ "x$STORAGE_BACKEND" == "xswift" ]; then + : ${OS_INTERFACE:="internal"} OS_TOKEN="$(openstack token issue -f value -c id)" OS_PROJECT_ID="$(openstack project show service -f value -c id)" - OS_SWIFT_ENDPOINT_PREFIX="$(openstack endpoint list --service swift --interface public -f value -c URL | awk -F '$' '{ print $1 }')" + OS_SWIFT_ENDPOINT_PREFIX="$(openstack endpoint list --service swift --interface ${OS_INTERFACE} -f value -c URL | awk -F '$' '{ print $1 }')" OS_SWIFT_SCOPED_ENDPOINT="${OS_SWIFT_ENDPOINT_PREFIX}${OS_PROJECT_ID}" curl -i -X POST "${OS_SWIFT_SCOPED_ENDPOINT}" \ -H "X-Auth-Token: ${OS_TOKEN}" \