This commit adds the ability to automatically set a tempurl key
in swift for service accounts.
Change-Id: I0d5d16c5601d022f034df2cc291106c5dc13511e
| ... | ... |
@@ -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 |
|
| ... | ... |
@@ -472,6 +472,10 @@ if is_service_enabled s-proxy; then |
| 472 | 472 |
# ``SWIFT_HASH`` is a random unique string for a swift cluster that |
| 473 | 473 |
# can never change. |
| 474 | 474 |
read_password SWIFT_HASH "ENTER A RANDOM SWIFT HASH." |
| 475 |
+ |
|
| 476 |
+ if [[ -z "$SWIFT_TEMPURL_KEY" ]] && [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]]; then |
|
| 477 |
+ read_password SWIFT_TEMPURL_KEY "ENTER A KEY FOR SWIFT TEMPURLS." |
|
| 478 |
+ fi |
|
| 475 | 479 |
fi |
| 476 | 480 |
|
| 477 | 481 |
|