Add swift tempurl support to devstack

This commit adds the ability to automatically set a tempurl key
in swift for service accounts.

Change-Id: I0d5d16c5601d022f034df2cc291106c5dc13511e
This commit is contained in:
Jim Rollenhagen 2014-08-05 18:01:48 +00:00
parent 4407315ae9
commit abbb0e9a0d
2 changed files with 19 additions and 0 deletions

View File

@ -115,6 +115,10 @@ OBJECT_PORT_BASE=${OBJECT_PORT_BASE:-6013}
CONTAINER_PORT_BASE=${CONTAINER_PORT_BASE:-6011}
ACCOUNT_PORT_BASE=${ACCOUNT_PORT_BASE:-6012}
# Enable tempurl feature
SWIFT_ENABLE_TEMPURLS=${SWIFT_ENABLE_TEMPURLS:-False}
SWIFT_TEMPURL_KEY=${SWIFT_TEMPURL_KEY}
# Tell Tempest this project is present
TEMPEST_SERVICES+=,swift
@ -679,6 +683,10 @@ function start_swift {
screen_it s-${type} "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-${type}-server ${SWIFT_CONF_DIR}/${type}-server/1.conf -v"
done
fi
if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]]; then
swift_configure_tempurls
fi
}
# stop_swift() - Stop running processes (non-screen)
@ -701,6 +709,13 @@ function stop_swift {
pkill -f swift-
}
function swift_configure_tempurls {
OS_USERNAME=swift \
OS_TENANT_NAME=$SERVICE_TENANT_NAME \
OS_PASSWORD=$SERVICE_PASSWORD \
swift post -m "Temp-URL-Key: $SWIFT_TEMPURL_KEY"
}
# Restore xtrace
$XTRACE

View File

@ -472,6 +472,10 @@ if is_service_enabled s-proxy; then
# ``SWIFT_HASH`` is a random unique string for a swift cluster that
# can never change.
read_password SWIFT_HASH "ENTER A RANDOM SWIFT HASH."
if [[ -z "$SWIFT_TEMPURL_KEY" ]] && [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]]; then
read_password SWIFT_TEMPURL_KEY "ENTER A KEY FOR SWIFT TEMPURLS."
fi
fi