Merge pull request #40105 from sc68cal/bugs/40102

Automatic merge from submit-queue (batch tested with PRs 40105, 40095)

[OpenStack-Heat] Fix regex used to get object-store URL

**Release note**:

```release-note

Fixes a bug in the OpenStack-Heat kubernetes provider, in the handling of differences between the Identity v2 and Identity v3 APIs

```
pull/6/head
Kubernetes Submit Queue 2017-01-18 15:54:08 -08:00 committed by GitHub
commit 0c61553cbc
1 changed files with 7 additions and 1 deletions

View File

@ -186,7 +186,13 @@ function run-heat-script() {
# Automatically detect swift url if it wasn't specified
if [[ -z $SWIFT_SERVER_URL ]]; then
SWIFT_SERVER_URL=$(openstack catalog show object-store --format value | egrep -o "publicURL: (.+)$" | cut -d" " -f2)
local rgx=""
if [ "$OS_IDENTITY_API_VERSION" = "3" ]; then
rgx="public: (.+)$"
else
rgx="publicURL: (.+)$"
fi
SWIFT_SERVER_URL=$(openstack catalog show object-store --format value | egrep -o "$rgx" | cut -d" " -f2)
fi
local swift_repo_url="${SWIFT_SERVER_URL}/kubernetes"