Blob Blame History Raw
From 4e661baaa7f51f6951e18b70db5c7e4c7e382165 Mon Sep 17 00:00:00 2001
From: Alan Pevec <apevec@redhat.com>
Date: Mon, 17 Sep 2012 20:51:49 +0200
Subject: [PATCH] add Swift endpoint in sample data

Change-Id: Idb1274adbcc28ccddc737d900062f5b8a5f81791
---
 tools/sample_data.sh |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/tools/sample_data.sh b/tools/sample_data.sh
index 18419a8..ced89dc 100755
--- a/tools/sample_data.sh
+++ b/tools/sample_data.sh
@@ -207,9 +207,10 @@ keystone service-create --name="horizon" \
 						--description="OpenStack Dashboard"
 
 if [[ -n "$ENABLE_SWIFT" ]]; then
+    SWIFT_SERVICE=$(get_id \
     keystone service-create --name=swift \
                             --type="object-store" \
-                            --description="Swift Service"
+                            --description="Swift Service")
     SWIFT_USER=$(get_id keystone user-create --name=swift \
                                              --pass="$SERVICE_PASSWORD" \
                                              --tenant_id $SERVICE_TENANT \
@@ -217,6 +218,12 @@ if [[ -n "$ENABLE_SWIFT" ]]; then
     keystone user-role-add --tenant_id $SERVICE_TENANT \
                            --user_id $SWIFT_USER \
                            --role_id $ADMIN_ROLE
+    if [[ -n "$ENABLE_ENDPOINTS" ]]; then
+        keystone endpoint-create --region RegionOne --service_id $SWIFT_SERVICE \
+            --publicurl   'http://localhost:8080/v1/AUTH_$(tenant_id)s' \
+            --adminurl    'http://localhost:8080/v1/AUTH_$(tenant_id)s' \
+            --internalurl 'http://localhost:8080/v1/AUTH_$(tenant_id)s'
+    fi
 fi
 
 if [[ -n "$ENABLE_QUANTUM" ]]; then