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
diff --git a/stack.sh b/stack.sh
index 8e71760..6789778 100755
--- a/stack.sh
+++ b/stack.sh
@@ -1298,6 +1298,23 @@
 
     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