From 11eb2017ef70a758c54cc984e90e445205886e7e Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 13 Feb 2017 16:16:59 -0500 Subject: [PATCH] simplify endpoints used in devstack The proliferation of internal/admin endpoints is mostly legacy and based on some specific deployment patterns. These are not used by everyone, and for the devstack case aren't really that useful. We should simplify our service catalog down to the minimum we need for development. Change-Id: Ided7a65c81b3a0b56f0184847fc82e17c29a771e --- functions-common | 12 ++++++++---- lib/cinder | 6 ------ lib/glance | 4 ---- lib/neutron | 2 -- lib/neutron-legacy | 2 -- lib/nova | 4 ---- lib/placement | 2 -- lib/swift | 3 +-- 8 files changed, 9 insertions(+), 26 deletions(-) diff --git a/functions-common b/functions-common index 8d32bb4148..f0940e57cf 100644 --- a/functions-common +++ b/functions-common @@ -992,7 +992,7 @@ function _get_or_create_endpoint_with_interface { } # Gets or creates endpoint -# Usage: get_or_create_endpoint +# Usage: get_or_create_endpoint [adminurl] [internalurl] function get_or_create_endpoint { # NOTE(jamielennnox): when converting to v3 endpoint creation we go from # creating one endpoint with multiple urls to multiple endpoints each with @@ -1004,9 +1004,13 @@ function get_or_create_endpoint { # endpoints they need. local public_id public_id=$(_get_or_create_endpoint_with_interface $1 public $3 $2) - _get_or_create_endpoint_with_interface $1 admin $4 $2 - _get_or_create_endpoint_with_interface $1 internal $5 $2 - + # only create admin/internal urls if provided content for them + if [[ -n "$4" ]]; then + _get_or_create_endpoint_with_interface $1 admin $4 $2 + fi + if [[ -n "$5" ]]; then + _get_or_create_endpoint_with_interface $1 internal $5 $2 + fi # return the public id to indicate success, and this is the endpoint most likely wanted echo $public_id } diff --git a/lib/cinder b/lib/cinder index 870ee0b905..24967d4151 100644 --- a/lib/cinder +++ b/lib/cinder @@ -395,24 +395,18 @@ function create_cinder_accounts { get_or_create_endpoint \ "volume" \ "$REGION_NAME" \ - "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(project_id)s" \ - "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(project_id)s" \ "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(project_id)s" get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2" get_or_create_endpoint \ "volumev2" \ "$REGION_NAME" \ - "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(project_id)s" \ - "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(project_id)s" \ "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(project_id)s" get_or_create_service "cinderv3" "volumev3" "Cinder Volume Service V3" get_or_create_endpoint \ "volumev3" \ "$REGION_NAME" \ - "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v3/\$(project_id)s" \ - "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v3/\$(project_id)s" \ "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v3/\$(project_id)s" configure_cinder_internal_tenant diff --git a/lib/glance b/lib/glance index 26c41507ed..58f1deff6f 100644 --- a/lib/glance +++ b/lib/glance @@ -314,8 +314,6 @@ function create_glance_accounts { get_or_create_endpoint \ "image" \ "$REGION_NAME" \ - "$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \ - "$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \ "$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" # Note(frickler): Crude workaround for https://bugs.launchpad.net/glance-store/+bug/1620999 @@ -331,8 +329,6 @@ function create_glance_accounts { get_or_create_endpoint "artifact" \ "$REGION_NAME" \ - "$GLANCE_SERVICE_PROTOCOL://$GLANCE_GLARE_HOSTPORT" \ - "$GLANCE_SERVICE_PROTOCOL://$GLANCE_GLARE_HOSTPORT" \ "$GLANCE_SERVICE_PROTOCOL://$GLANCE_GLARE_HOSTPORT" fi } diff --git a/lib/neutron b/lib/neutron index 9b032b72e2..19568eaf25 100644 --- a/lib/neutron +++ b/lib/neutron @@ -330,8 +330,6 @@ function create_neutron_accounts_new { "network" "Neutron Service") get_or_create_endpoint $neutron_service \ "$REGION_NAME" \ - "$NEUTRON_SERVICE_PROTOCOL://$NEUTRON_SERVICE_HOST:$NEUTRON_SERVICE_PORT/" \ - "$NEUTRON_SERVICE_PROTOCOL://$NEUTRON_SERVICE_HOST:$NEUTRON_SERVICE_PORT/" \ "$NEUTRON_SERVICE_PROTOCOL://$NEUTRON_SERVICE_HOST:$NEUTRON_SERVICE_PORT/" fi } diff --git a/lib/neutron-legacy b/lib/neutron-legacy index af91470e65..b381b642c6 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -410,8 +410,6 @@ function create_mutnauq_accounts { get_or_create_endpoint \ "network" \ "$REGION_NAME" \ - "$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" \ - "$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" \ "$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" fi } diff --git a/lib/nova b/lib/nova index 4d336f6271..7c2fddbc75 100644 --- a/lib/nova +++ b/lib/nova @@ -407,16 +407,12 @@ function create_nova_accounts { get_or_create_endpoint \ "compute_legacy" \ "$REGION_NAME" \ - "$nova_api_url/v2/\$(project_id)s" \ - "$nova_api_url/v2/\$(project_id)s" \ "$nova_api_url/v2/\$(project_id)s" get_or_create_service "nova" "compute" "Nova Compute Service" get_or_create_endpoint \ "compute" \ "$REGION_NAME" \ - "$nova_api_url/v2.1" \ - "$nova_api_url/v2.1" \ "$nova_api_url/v2.1" fi diff --git a/lib/placement b/lib/placement index 871e282f32..e7ffe3330b 100644 --- a/lib/placement +++ b/lib/placement @@ -132,8 +132,6 @@ function create_placement_accounts { get_or_create_endpoint \ "placement" \ "$REGION_NAME" \ - "$placement_api_url" \ - "$placement_api_url" \ "$placement_api_url" } diff --git a/lib/swift b/lib/swift index 03fd454dc6..5b510e5930 100644 --- a/lib/swift +++ b/lib/swift @@ -636,8 +636,7 @@ function create_swift_accounts { "object-store" \ "$REGION_NAME" \ "$SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT/v1/AUTH_\$(project_id)s" \ - "$SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT" \ - "$SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT/v1/AUTH_\$(project_id)s" + "$SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT" local swift_project_test1 swift_project_test1=$(get_or_create_project swiftprojecttest1 default)