Browse code

Merge "Add swift tempurl support to devstack"

Jenkins authored on 2014/08/15 13:51:28
Showing 2 changed files
... ...
@@ -115,6 +115,10 @@ OBJECT_PORT_BASE=${OBJECT_PORT_BASE:-6013}
115 115
 CONTAINER_PORT_BASE=${CONTAINER_PORT_BASE:-6011}
116 116
 ACCOUNT_PORT_BASE=${ACCOUNT_PORT_BASE:-6012}
117 117
 
118
+# Enable tempurl feature
119
+SWIFT_ENABLE_TEMPURLS=${SWIFT_ENABLE_TEMPURLS:-False}
120
+SWIFT_TEMPURL_KEY=${SWIFT_TEMPURL_KEY}
121
+
118 122
 # Tell Tempest this project is present
119 123
 TEMPEST_SERVICES+=,swift
120 124
 
... ...
@@ -679,6 +683,10 @@ function start_swift {
679 679
             screen_it s-${type} "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-${type}-server ${SWIFT_CONF_DIR}/${type}-server/1.conf -v"
680 680
         done
681 681
     fi
682
+
683
+    if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]]; then
684
+        swift_configure_tempurls
685
+    fi
682 686
 }
683 687
 
684 688
 # stop_swift() - Stop running processes (non-screen)
... ...
@@ -701,6 +709,13 @@ function stop_swift {
701 701
     pkill -f swift-
702 702
 }
703 703
 
704
+function swift_configure_tempurls {
705
+    OS_USERNAME=swift \
706
+        OS_TENANT_NAME=$SERVICE_TENANT_NAME \
707
+        OS_PASSWORD=$SERVICE_PASSWORD \
708
+        swift post -m "Temp-URL-Key: $SWIFT_TEMPURL_KEY"
709
+}
710
+
704 711
 # Restore xtrace
705 712
 $XTRACE
706 713
 
... ...
@@ -474,6 +474,10 @@ if is_service_enabled s-proxy; then
474 474
     # ``SWIFT_HASH`` is a random unique string for a swift cluster that
475 475
     # can never change.
476 476
     read_password SWIFT_HASH "ENTER A RANDOM SWIFT HASH."
477
+
478
+    if [[ -z "$SWIFT_TEMPURL_KEY" ]] && [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]]; then
479
+        read_password SWIFT_TEMPURL_KEY "ENTER A KEY FOR SWIFT TEMPURLS."
480
+    fi
477 481
 fi
478 482
 
479 483