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:
parent
4407315ae9
commit
abbb0e9a0d
15
lib/swift
15
lib/swift
@ -115,6 +115,10 @@ OBJECT_PORT_BASE=${OBJECT_PORT_BASE:-6013}
|
|||||||
CONTAINER_PORT_BASE=${CONTAINER_PORT_BASE:-6011}
|
CONTAINER_PORT_BASE=${CONTAINER_PORT_BASE:-6011}
|
||||||
ACCOUNT_PORT_BASE=${ACCOUNT_PORT_BASE:-6012}
|
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
|
# Tell Tempest this project is present
|
||||||
TEMPEST_SERVICES+=,swift
|
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"
|
screen_it s-${type} "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-${type}-server ${SWIFT_CONF_DIR}/${type}-server/1.conf -v"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]]; then
|
||||||
|
swift_configure_tempurls
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# stop_swift() - Stop running processes (non-screen)
|
# stop_swift() - Stop running processes (non-screen)
|
||||||
@ -701,6 +709,13 @@ function stop_swift {
|
|||||||
pkill -f 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
|
# Restore xtrace
|
||||||
$XTRACE
|
$XTRACE
|
||||||
|
|
||||||
|
4
stack.sh
4
stack.sh
@ -472,6 +472,10 @@ if is_service_enabled s-proxy; then
|
|||||||
# ``SWIFT_HASH`` is a random unique string for a swift cluster that
|
# ``SWIFT_HASH`` is a random unique string for a swift cluster that
|
||||||
# can never change.
|
# can never change.
|
||||||
read_password SWIFT_HASH "ENTER A RANDOM SWIFT HASH."
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user