Skip to content

Commit 985e958

Browse files
committed
remove keystone templated catalog
This is just another code path for little benefit in devstack which is going to rot out. We should be opinionated here and only support the dynamic catalog. Change-Id: I4e5c7e86aefe72fc21c77d423033e9b169318fec
1 parent 1a9e294 commit 985e958

9 files changed

Lines changed: 93 additions & 223 deletions

File tree

doc/source/configuration.rst

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -379,24 +379,6 @@ that matches requirements.
379379

380380
PIP_UPGRADE=True
381381

382-
383-
Service Catalog Backend
384-
-----------------------
385-
386-
By default DevStack uses Keystone's ``sql`` service catalog backend.
387-
An alternate ``template`` backend is also available, however, it does
388-
not support the ``service-*`` and ``endpoint-*`` commands of the
389-
``keystone`` CLI. To do so requires the ``sql`` backend be enabled
390-
with ``KEYSTONE_CATALOG_BACKEND``:
391-
392-
::
393-
394-
KEYSTONE_CATALOG_BACKEND=template
395-
396-
DevStack's default configuration in ``sql`` mode is set in
397-
``lib/keystone``
398-
399-
400382
Guest Images
401383
------------
402384

files/default_catalog.templates

Lines changed: 0 additions & 63 deletions
This file was deleted.

lib/cinder

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -369,20 +369,21 @@ function create_cinder_accounts {
369369

370370
create_service_user "cinder"
371371

372-
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
373-
374-
get_or_create_service "cinder" "volume" "Cinder Volume Service"
375-
get_or_create_endpoint "volume" "$REGION_NAME" \
376-
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
377-
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
378-
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
379-
380-
get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2"
381-
get_or_create_endpoint "volumev2" "$REGION_NAME" \
382-
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \
383-
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \
384-
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s"
385-
fi
372+
get_or_create_service "cinder" "volume" "Cinder Volume Service"
373+
get_or_create_endpoint \
374+
"volume" \
375+
"$REGION_NAME" \
376+
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
377+
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
378+
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
379+
380+
get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2"
381+
get_or_create_endpoint \
382+
"volumev2" \
383+
"$REGION_NAME" \
384+
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \
385+
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \
386+
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s"
386387
fi
387388
}
388389

lib/glance

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,13 @@ function create_glance_accounts {
244244
get_or_add_user_project_role "ResellerAdmin" $glance_swift_user $SERVICE_TENANT_NAME
245245
fi
246246

247-
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
248-
249-
get_or_create_service "glance" "image" "Glance Image Service"
250-
get_or_create_endpoint "image" \
251-
"$REGION_NAME" \
252-
"$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \
253-
"$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \
254-
"$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT"
255-
fi
247+
get_or_create_service "glance" "image" "Glance Image Service"
248+
get_or_create_endpoint \
249+
"image" \
250+
"$REGION_NAME" \
251+
"$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \
252+
"$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \
253+
"$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT"
256254
fi
257255
}
258256

lib/heat

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -387,23 +387,21 @@ function create_heat_accounts {
387387
if [[ "$HEAT_STANDALONE" != "True" ]]; then
388388

389389
create_service_user "heat" "admin"
390-
391-
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
392-
393-
get_or_create_service "heat" "orchestration" "Heat Orchestration Service"
394-
get_or_create_endpoint "orchestration" \
395-
"$REGION_NAME" \
396-
"$SERVICE_PROTOCOL://$HEAT_API_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
397-
"$SERVICE_PROTOCOL://$HEAT_API_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
398-
"$SERVICE_PROTOCOL://$HEAT_API_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s"
399-
400-
get_or_create_service "heat-cfn" "cloudformation" "Heat CloudFormation Service"
401-
get_or_create_endpoint "cloudformation" \
402-
"$REGION_NAME" \
403-
"$SERVICE_PROTOCOL://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1" \
404-
"$SERVICE_PROTOCOL://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1" \
405-
"$SERVICE_PROTOCOL://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1"
406-
fi
390+
get_or_create_service "heat" "orchestration" "Heat Orchestration Service"
391+
get_or_create_endpoint \
392+
"orchestration" \
393+
"$REGION_NAME" \
394+
"$SERVICE_PROTOCOL://$HEAT_API_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
395+
"$SERVICE_PROTOCOL://$HEAT_API_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
396+
"$SERVICE_PROTOCOL://$HEAT_API_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s"
397+
398+
get_or_create_service "heat-cfn" "cloudformation" "Heat CloudFormation Service"
399+
get_or_create_endpoint \
400+
"cloudformation" \
401+
"$REGION_NAME" \
402+
"$SERVICE_PROTOCOL://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1" \
403+
"$SERVICE_PROTOCOL://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1" \
404+
"$SERVICE_PROTOCOL://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1"
407405

408406
# heat_stack_user role is for users created by Heat
409407
get_or_create_role "heat_stack_user"

lib/keystone

Lines changed: 14 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,12 @@ KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone}
5252
KEYSTONE_CONF=$KEYSTONE_CONF_DIR/keystone.conf
5353
KEYSTONE_PASTE_INI=${KEYSTONE_PASTE_INI:-$KEYSTONE_CONF_DIR/keystone-paste.ini}
5454

55+
# NOTE(sdague): remove in Newton
56+
KEYSTONE_CATALOG_BACKEND="sql"
57+
5558
# Toggle for deploying Keystone under HTTPD + mod_wsgi
5659
KEYSTONE_USE_MOD_WSGI=${KEYSTONE_USE_MOD_WSGI:-${ENABLE_HTTPD_MOD_WSGI_SERVICES}}
5760

58-
# Select the Catalog backend driver
59-
KEYSTONE_CATALOG_BACKEND=${KEYSTONE_CATALOG_BACKEND:-sql}
60-
KEYSTONE_CATALOG=$KEYSTONE_CONF_DIR/default_catalog.templates
61-
6261
# Select the token persistence backend driver
6362
KEYSTONE_TOKEN_BACKEND=${KEYSTONE_TOKEN_BACKEND:-sql}
6463

@@ -254,39 +253,6 @@ function configure_keystone {
254253

255254
iniset $KEYSTONE_CONF token driver "$KEYSTONE_TOKEN_BACKEND"
256255

257-
iniset $KEYSTONE_CONF catalog driver "$KEYSTONE_CATALOG_BACKEND"
258-
if [[ "$KEYSTONE_CATALOG_BACKEND" = "sql" ]]; then
259-
# Configure ``keystone.conf`` to use sql
260-
inicomment $KEYSTONE_CONF catalog template_file
261-
else
262-
deprecated "Using templated service catalog in devstack is deprecated"
263-
cp -p $FILES/default_catalog.templates $KEYSTONE_CATALOG
264-
265-
# Add swift endpoints to service catalog if swift is enabled
266-
if is_service_enabled s-proxy; then
267-
echo "catalog.RegionOne.object_store.publicURL = http://%SERVICE_HOST%:$SWIFT_DEFAULT_BIND_PORT/v1/AUTH_\$(tenant_id)s" >> $KEYSTONE_CATALOG
268-
echo "catalog.RegionOne.object_store.adminURL = http://%SERVICE_HOST%:$SWIFT_DEFAULT_BIND_PORT/" >> $KEYSTONE_CATALOG
269-
echo "catalog.RegionOne.object_store.internalURL = http://%SERVICE_HOST%:$SWIFT_DEFAULT_BIND_PORT/v1/AUTH_\$(tenant_id)s" >> $KEYSTONE_CATALOG
270-
echo "catalog.RegionOne.object_store.name = Swift Service" >> $KEYSTONE_CATALOG
271-
fi
272-
273-
# Add neutron endpoints to service catalog if neutron is enabled
274-
if is_service_enabled neutron; then
275-
echo "catalog.RegionOne.network.publicURL = http://%SERVICE_HOST%:$Q_PORT/" >> $KEYSTONE_CATALOG
276-
echo "catalog.RegionOne.network.adminURL = http://%SERVICE_HOST%:$Q_PORT/" >> $KEYSTONE_CATALOG
277-
echo "catalog.RegionOne.network.internalURL = http://%SERVICE_HOST%:$Q_PORT/" >> $KEYSTONE_CATALOG
278-
echo "catalog.RegionOne.network.name = Neutron Service" >> $KEYSTONE_CATALOG
279-
fi
280-
281-
sed -e "
282-
s,%SERVICE_HOST%,$SERVICE_HOST,g;
283-
s,%S3_SERVICE_PORT%,$S3_SERVICE_PORT,g;
284-
" -i $KEYSTONE_CATALOG
285-
286-
# Configure ``keystone.conf`` to use templates
287-
iniset $KEYSTONE_CONF catalog template_file "$KEYSTONE_CATALOG"
288-
fi
289-
290256
# Set up logging
291257
if [ "$SYSLOG" != "False" ]; then
292258
iniset $KEYSTONE_CONF DEFAULT use_syslog "True"
@@ -588,7 +554,6 @@ function stop_keystone {
588554
# - ``KEYSTONE_BIN_DIR``
589555
# - ``ADMIN_PASSWORD``
590556
# - ``IDENTITY_API_VERSION``
591-
# - ``KEYSTONE_CATALOG_BACKEND``
592557
# - ``KEYSTONE_AUTH_URI``
593558
# - ``REGION_NAME``
594559
# - ``KEYSTONE_SERVICE_PROTOCOL``
@@ -616,19 +581,17 @@ function bootstrap_keystone {
616581
--os-identity-api-version 3 --os-auth-url $KEYSTONE_AUTH_URI \
617582
--os-password $ADMIN_PASSWORD)
618583

619-
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
620-
621-
export OS_TOKEN=$token_id
622-
export OS_URL=$KEYSTONE_AUTH_URI/v3
623-
export OS_IDENTITY_API_VERSION=3
624-
625-
get_or_create_service "keystone" "identity" "Keystone Identity Service"
626-
get_or_create_endpoint "identity" \
627-
"$REGION_NAME" \
628-
"$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$IDENTITY_API_VERSION" \
629-
"$KEYSTONE_AUTH_URI/v$IDENTITY_API_VERSION" \
630-
"$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$IDENTITY_API_VERSION"
631-
fi
584+
export OS_TOKEN=$token_id
585+
export OS_URL=$KEYSTONE_AUTH_URI/v3
586+
export OS_IDENTITY_API_VERSION=3
587+
588+
get_or_create_service "keystone" "identity" "Keystone Identity Service"
589+
get_or_create_endpoint \
590+
"identity" \
591+
"$REGION_NAME" \
592+
"$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$IDENTITY_API_VERSION" \
593+
"$KEYSTONE_AUTH_URI/v$IDENTITY_API_VERSION" \
594+
"$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$IDENTITY_API_VERSION"
632595

633596
unset OS_TOKEN OS_URL OS_IDENTITY_API_VERSION
634597
}

lib/neutron-legacy

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -525,15 +525,13 @@ function create_neutron_accounts {
525525

526526
create_service_user "neutron"
527527

528-
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
529-
530-
get_or_create_service "neutron" "network" "Neutron Service"
531-
get_or_create_endpoint "network" \
532-
"$REGION_NAME" \
533-
"$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" \
534-
"$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" \
535-
"$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/"
536-
fi
528+
get_or_create_service "neutron" "network" "Neutron Service"
529+
get_or_create_endpoint \
530+
"network" \
531+
"$REGION_NAME" \
532+
"$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" \
533+
"$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/" \
534+
"$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/"
537535
fi
538536
}
539537

lib/nova

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -415,29 +415,28 @@ function create_nova_accounts {
415415
# this service user when notifying nova of changes and that requires the admin role.
416416
create_service_user "nova" "admin"
417417

418-
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
419-
local nova_api_url
420-
if [[ "$NOVA_USE_MOD_WSGI" == "False" ]]; then
421-
nova_api_url="$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT"
422-
else
423-
nova_api_url="$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST/compute"
424-
fi
425-
426-
get_or_create_service "nova_legacy" "compute_legacy" \
427-
"Nova Compute Service (Legacy 2.0)"
428-
get_or_create_endpoint "compute_legacy" \
429-
"$REGION_NAME" \
430-
"$nova_api_url/v2/\$(tenant_id)s" \
431-
"$nova_api_url/v2/\$(tenant_id)s" \
432-
"$nova_api_url/v2/\$(tenant_id)s"
433-
434-
get_or_create_service "nova" "compute" "Nova Compute Service"
435-
get_or_create_endpoint "compute" \
436-
"$REGION_NAME" \
437-
"$nova_api_url/v2.1/\$(tenant_id)s" \
438-
"$nova_api_url/v2.1/\$(tenant_id)s" \
439-
"$nova_api_url/v2.1/\$(tenant_id)s"
418+
local nova_api_url
419+
if [[ "$NOVA_USE_MOD_WSGI" == "False" ]]; then
420+
nova_api_url="$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT"
421+
else
422+
nova_api_url="$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST/compute"
440423
fi
424+
425+
get_or_create_service "nova_legacy" "compute_legacy" "Nova Compute Service (Legacy 2.0)"
426+
get_or_create_endpoint \
427+
"compute_legacy" \
428+
"$REGION_NAME" \
429+
"$nova_api_url/v2/\$(tenant_id)s" \
430+
"$nova_api_url/v2/\$(tenant_id)s" \
431+
"$nova_api_url/v2/\$(tenant_id)s"
432+
433+
get_or_create_service "nova" "compute" "Nova Compute Service"
434+
get_or_create_endpoint \
435+
"compute" \
436+
"$REGION_NAME" \
437+
"$nova_api_url/v2.1/\$(tenant_id)s" \
438+
"$nova_api_url/v2.1/\$(tenant_id)s" \
439+
"$nova_api_url/v2.1/\$(tenant_id)s"
441440
fi
442441

443442
if is_service_enabled n-api; then
@@ -451,15 +450,13 @@ function create_nova_accounts {
451450

452451
# S3
453452
if is_service_enabled swift3; then
454-
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
455-
456-
get_or_create_service "s3" "s3" "S3"
457-
get_or_create_endpoint "s3" \
458-
"$REGION_NAME" \
459-
"http://$SERVICE_HOST:$S3_SERVICE_PORT" \
460-
"http://$SERVICE_HOST:$S3_SERVICE_PORT" \
461-
"http://$SERVICE_HOST:$S3_SERVICE_PORT"
462-
fi
453+
get_or_create_service "s3" "s3" "S3"
454+
get_or_create_endpoint \
455+
"s3" \
456+
"$REGION_NAME" \
457+
"http://$SERVICE_HOST:$S3_SERVICE_PORT" \
458+
"http://$SERVICE_HOST:$S3_SERVICE_PORT" \
459+
"http://$SERVICE_HOST:$S3_SERVICE_PORT"
463460
fi
464461
}
465462

0 commit comments

Comments
 (0)