From 7bd3087e73c0683acf5df40d1eed51709d865c06 Mon Sep 17 00:00:00 2001 From: Gabriel Hurley Date: Thu, 23 Feb 2012 13:20:03 -0800 Subject: [PATCH] Only add Quantum and Swift to Keystone catalog if enabled. Incidentally removes some outdated (unused) settings from the Horizon settings file. Fixes bug 939820. Change-Id: I61e97c194070e46d21a6c0eb66eef88bd14efeee --- files/default_catalog.templates | 12 ------------ files/horizon_settings.py | 7 ------- stack.sh | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/files/default_catalog.templates b/files/default_catalog.templates index a5b45d7317..f6125bb9df 100644 --- a/files/default_catalog.templates +++ b/files/default_catalog.templates @@ -22,15 +22,3 @@ catalog.RegionOne.image.publicURL = http://%SERVICE_HOST%:9292/v1 catalog.RegionOne.image.adminURL = http://%SERVICE_HOST%:9292/v1 catalog.RegionOne.image.internalURL = http://%SERVICE_HOST%:9292/v1 catalog.RegionOne.image.name = 'Image Service' - - -catalog.RegionOne.object_store.publicURL = http://%SERVICE_HOST%:8080/v1/AUTH_$(tenant_id)s -catalog.RegionOne.object_store.adminURL = http://%SERVICE_HOST%:8080/ -catalog.RegionOne.object_store.internalURL = http://%SERVICE_HOST%:8080/v1/AUTH_$(tenant_id)s -catalog.RegionOne.object_store.name = 'Swift Service' - - -catalog.RegionOne.network.publicURL = http://%SERVICE_HOST%:9696/ -catalog.RegionOne.network.adminURL = http://%SERVICE_HOST%:9696/ -catalog.RegionOne.network.internalURL = http://%SERVICE_HOST%:9696/ -catalog.RegionOne.network.name = 'Quantum Service' diff --git a/files/horizon_settings.py b/files/horizon_settings.py index 05ddfe7bf9..bbff08fa03 100644 --- a/files/horizon_settings.py +++ b/files/horizon_settings.py @@ -49,13 +49,6 @@ OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member" SWIFT_PAGINATE_LIMIT = 100 -# Configure quantum connection details for networking -QUANTUM_ENABLED = False -QUANTUM_URL = '%s' % OPENSTACK_HOST -QUANTUM_PORT = '9696' -QUANTUM_TENANT = '1234' -QUANTUM_CLIENT_VERSION='0.1' - # If you have external monitoring links, eg: # EXTERNAL_MONITORING = [ # ['Nagios','http://foo.com'], diff --git a/stack.sh b/stack.sh index 8e717604fb..6789778ff0 100755 --- a/stack.sh +++ b/stack.sh @@ -1298,6 +1298,23 @@ if is_service_enabled key; then KEYSTONE_CATALOG=$KEYSTONE_DIR/etc/default_catalog.templates cp $FILES/default_catalog.templates $KEYSTONE_CATALOG + + # Add swift endpoints to service catalog if swift is enabled + if is_service_enabled swift; then + echo "catalog.RegionOne.object_store.publicURL = http://%SERVICE_HOST%:8080/v1/AUTH_$(tenant_id)s" >> $KEYSTONE_CATALOG + echo "catalog.RegionOne.object_store.adminURL = http://%SERVICE_HOST%:8080/" >> $KEYSTONE_CATALOG + echo "catalog.RegionOne.object_store.internalURL = http://%SERVICE_HOST%:8080/v1/AUTH_$(tenant_id)s" >> $KEYSTONE_CATALOG + echo "catalog.RegionOne.object_store.name = 'Swift Service'" >> $KEYSTONE_CATALOG + fi + + # Add quantum endpoints to service catalog if quantum is enabled + if is_service_enabled quantum; then + echo "catalog.RegionOne.network.publicURL = http://%SERVICE_HOST%:9696/" >> $KEYSTONE_CATALOG + echo "catalog.RegionOne.network.adminURL = http://%SERVICE_HOST%:9696/" >> $KEYSTONE_CATALOG + echo "catalog.RegionOne.network.internalURL = http://%SERVICE_HOST%:9696/" >> $KEYSTONE_CATALOG + echo "catalog.RegionOne.network.name = 'Quantum Service'" >> $KEYSTONE_CATALOG + fi + sudo sed -e "s,%SERVICE_HOST%,$SERVICE_HOST,g" -i $KEYSTONE_CATALOG