From 1991e7599313cdbc75cf7674df94f32e9443cc60 Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Tue, 11 Aug 2015 19:34:22 +0200 Subject: [PATCH] Fix creation of endpoints in multi-region Keystone API v3 does currently not support filtering for region names. As a consequence an additional check is needed in get_or_create_endpoint to check if an endpoint must be created for a given region or if it already exists. See related bug for more information regarding the missing region filtering in keystone. Closes-Bug: #1483784 Related-Bug: #1482772 Change-Id: Ia6a497b9fb58f7474636ab52dc01b99857bed3a2 --- functions-common | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functions-common b/functions-common index 60cf04c499..641eca8362 100644 --- a/functions-common +++ b/functions-common @@ -852,13 +852,18 @@ function get_or_create_service { # Usage: _get_or_create_endpoint_with_interface function _get_or_create_endpoint_with_interface { local endpoint_id + # TODO(dgonzalez): The check of the region name, as done in the grep + # statement below, exists only because keystone does currently + # not allow filtering the region name when listing endpoints. If keystone + # gets support for this, the check for the region name can be removed. + # Related bug in keystone: https://bugs.launchpad.net/keystone/+bug/1482772 endpoint_id=$(openstack endpoint list \ --os-url $KEYSTONE_SERVICE_URI_V3 \ --os-identity-api-version=3 \ --service $1 \ --interface $2 \ --region $4 \ - -c ID -f value) + -c ID -c Region -f value | grep $4 | cut -f 1 -d " ") if [[ -z "$endpoint_id" ]]; then # Creates new endpoint endpoint_id=$(openstack endpoint create \