Add backwards compatibility for openstackclient

Im deploying manually TripleO (latest master)
and using endpoint list does not return any valid value.

Applying the current patch both options for 'list or show'
will be used if the first its not able to get the endpoint correctly.

Change-Id: I10b10a5017ba255d8df9547e928418cad9cf04ff
This commit is contained in:
Carlos Camacho 2016-08-18 11:56:25 +00:00
parent 5be0dd82fe
commit 7d41589d59
1 changed files with 6 additions and 1 deletions

View File

@ -93,7 +93,12 @@ EOF_CAT
swift post "$CONTAINER_NAME"
SWIFT_ACCOUNT=$(swift stat "$CONTAINER_NAME" 2>/dev/null | grep Account: | sed -e "s|.*Account..||")
SWIFT_INTERNAL_URL=$(openstack endpoint list | grep swift | grep internal | sed -e "s|.*\(http.*\)://\([^/]*\)/.*|\1://\2|")
SWIFT_INTERNAL_URL=$(openstack endpoint show swift | grep internalurl | sed -e "s|.*\(http.*\)://\([^/]*\)/.*|\1://\2|")
if [ -z "$SWIFT_INTERNAL_URL" ]; then
SWIFT_INTERNAL_URL=$(openstack endpoint list | grep swift | grep internal | sed -e "s|.*\(http.*\)://\([^/]*\)/.*|\1://\2|")
fi
# Does the Temp-URL-Key exist on this container?
# If not set it...