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
diff --git a/functions-common b/functions-common
index 8d32bb4..f0940e5 100644
--- a/functions-common
+++ b/functions-common
@@ -992,7 +992,7 @@
}
# Gets or creates endpoint
-# Usage: get_or_create_endpoint <service> <region> <publicurl> <adminurl> <internalurl>
+# Usage: get_or_create_endpoint <service> <region> <publicurl> [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 @@
# 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 870ee0b..24967d4 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -395,24 +395,18 @@
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 26c4150..58f1def 100644
--- a/lib/glance
+++ b/lib/glance
@@ -314,8 +314,6 @@
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 @@
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 9b032b7..19568ea 100644
--- a/lib/neutron
+++ b/lib/neutron
@@ -330,8 +330,6 @@
"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 af91470..b381b64 100644
--- a/lib/neutron-legacy
+++ b/lib/neutron-legacy
@@ -410,8 +410,6 @@
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 4d336f6..7c2fddb 100644
--- a/lib/nova
+++ b/lib/nova
@@ -407,16 +407,12 @@
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 871e282..e7ffe33 100644
--- a/lib/placement
+++ b/lib/placement
@@ -132,8 +132,6 @@
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 03fd454..5b510e5 100644
--- a/lib/swift
+++ b/lib/swift
@@ -636,8 +636,7 @@
"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)