Browse code

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

Sean Dague authored on 2017/02/14 06:16:59
Showing 8 changed files
... ...
@@ -992,7 +992,7 @@ function _get_or_create_endpoint_with_interface {
992 992
 }
993 993
 
994 994
 # Gets or creates endpoint
995
-# Usage: get_or_create_endpoint <service> <region> <publicurl> <adminurl> <internalurl>
995
+# Usage: get_or_create_endpoint <service> <region> <publicurl> [adminurl] [internalurl]
996 996
 function get_or_create_endpoint {
997 997
     # NOTE(jamielennnox): when converting to v3 endpoint creation we go from
998 998
     # creating one endpoint with multiple urls to multiple endpoints each with
... ...
@@ -1004,9 +1004,13 @@ function get_or_create_endpoint {
1004 1004
     # endpoints they need.
1005 1005
     local public_id
1006 1006
     public_id=$(_get_or_create_endpoint_with_interface $1 public $3 $2)
1007
-    _get_or_create_endpoint_with_interface $1 admin $4 $2
1008
-    _get_or_create_endpoint_with_interface $1 internal $5 $2
1009
-
1007
+    # only create admin/internal urls if provided content for them
1008
+    if [[ -n "$4" ]]; then
1009
+        _get_or_create_endpoint_with_interface $1 admin $4 $2
1010
+    fi
1011
+    if [[ -n "$5" ]]; then
1012
+        _get_or_create_endpoint_with_interface $1 internal $5 $2
1013
+    fi
1010 1014
     # return the public id to indicate success, and this is the endpoint most likely wanted
1011 1015
     echo $public_id
1012 1016
 }
... ...
@@ -395,24 +395,18 @@ function create_cinder_accounts {
395 395
         get_or_create_endpoint \
396 396
             "volume" \
397 397
             "$REGION_NAME" \
398
-            "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(project_id)s" \
399
-            "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(project_id)s" \
400 398
             "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(project_id)s"
401 399
 
402 400
         get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2"
403 401
         get_or_create_endpoint \
404 402
             "volumev2" \
405 403
             "$REGION_NAME" \
406
-            "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(project_id)s" \
407
-            "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(project_id)s" \
408 404
             "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(project_id)s"
409 405
 
410 406
         get_or_create_service "cinderv3" "volumev3" "Cinder Volume Service V3"
411 407
         get_or_create_endpoint \
412 408
             "volumev3" \
413 409
             "$REGION_NAME" \
414
-            "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v3/\$(project_id)s" \
415
-            "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v3/\$(project_id)s" \
416 410
             "$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v3/\$(project_id)s"
417 411
 
418 412
         configure_cinder_internal_tenant
... ...
@@ -314,8 +314,6 @@ function create_glance_accounts {
314 314
         get_or_create_endpoint \
315 315
             "image" \
316 316
             "$REGION_NAME" \
317
-            "$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \
318
-            "$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \
319 317
             "$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT"
320 318
 
321 319
         # Note(frickler): Crude workaround for https://bugs.launchpad.net/glance-store/+bug/1620999
... ...
@@ -331,8 +329,6 @@ function create_glance_accounts {
331 331
 
332 332
         get_or_create_endpoint "artifact" \
333 333
             "$REGION_NAME" \
334
-            "$GLANCE_SERVICE_PROTOCOL://$GLANCE_GLARE_HOSTPORT" \
335
-            "$GLANCE_SERVICE_PROTOCOL://$GLANCE_GLARE_HOSTPORT" \
336 334
             "$GLANCE_SERVICE_PROTOCOL://$GLANCE_GLARE_HOSTPORT"
337 335
     fi
338 336
 }
... ...
@@ -330,8 +330,6 @@ function create_neutron_accounts_new {
330 330
             "network" "Neutron Service")
331 331
         get_or_create_endpoint $neutron_service \
332 332
             "$REGION_NAME" \
333
-            "$NEUTRON_SERVICE_PROTOCOL://$NEUTRON_SERVICE_HOST:$NEUTRON_SERVICE_PORT/" \
334
-            "$NEUTRON_SERVICE_PROTOCOL://$NEUTRON_SERVICE_HOST:$NEUTRON_SERVICE_PORT/" \
335 333
             "$NEUTRON_SERVICE_PROTOCOL://$NEUTRON_SERVICE_HOST:$NEUTRON_SERVICE_PORT/"
336 334
     fi
337 335
 }
... ...
@@ -410,8 +410,6 @@ function create_mutnauq_accounts {
410 410
         get_or_create_endpoint \
411 411
             "network" \
412 412
             "$REGION_NAME" \
413
-            "$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" \
414
-            "$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" \
415 413
             "$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/"
416 414
     fi
417 415
 }
... ...
@@ -407,16 +407,12 @@ function create_nova_accounts {
407 407
         get_or_create_endpoint \
408 408
             "compute_legacy" \
409 409
             "$REGION_NAME" \
410
-            "$nova_api_url/v2/\$(project_id)s" \
411
-            "$nova_api_url/v2/\$(project_id)s" \
412 410
             "$nova_api_url/v2/\$(project_id)s"
413 411
 
414 412
         get_or_create_service "nova" "compute" "Nova Compute Service"
415 413
         get_or_create_endpoint \
416 414
             "compute" \
417 415
             "$REGION_NAME" \
418
-            "$nova_api_url/v2.1" \
419
-            "$nova_api_url/v2.1" \
420 416
             "$nova_api_url/v2.1"
421 417
     fi
422 418
 
... ...
@@ -132,8 +132,6 @@ function create_placement_accounts {
132 132
     get_or_create_endpoint \
133 133
         "placement" \
134 134
         "$REGION_NAME" \
135
-        "$placement_api_url" \
136
-        "$placement_api_url" \
137 135
         "$placement_api_url"
138 136
 }
139 137
 
... ...
@@ -636,8 +636,7 @@ function create_swift_accounts {
636 636
         "object-store" \
637 637
         "$REGION_NAME" \
638 638
         "$SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT/v1/AUTH_\$(project_id)s" \
639
-        "$SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT" \
640
-        "$SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT/v1/AUTH_\$(project_id)s"
639
+        "$SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT"
641 640
 
642 641
     local swift_project_test1
643 642
     swift_project_test1=$(get_or_create_project swiftprojecttest1 default)