Skip to content

Commit c85e428

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Add swift tempurl support to devstack"
2 parents a3ecab6 + abbb0e9 commit c85e428

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

lib/swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ OBJECT_PORT_BASE=${OBJECT_PORT_BASE:-6013}
115115
CONTAINER_PORT_BASE=${CONTAINER_PORT_BASE:-6011}
116116
ACCOUNT_PORT_BASE=${ACCOUNT_PORT_BASE:-6012}
117117

118+
# Enable tempurl feature
119+
SWIFT_ENABLE_TEMPURLS=${SWIFT_ENABLE_TEMPURLS:-False}
120+
SWIFT_TEMPURL_KEY=${SWIFT_TEMPURL_KEY}
121+
118122
# Tell Tempest this project is present
119123
TEMPEST_SERVICES+=,swift
120124

@@ -679,6 +683,10 @@ function start_swift {
679683
screen_it s-${type} "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-${type}-server ${SWIFT_CONF_DIR}/${type}-server/1.conf -v"
680684
done
681685
fi
686+
687+
if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]]; then
688+
swift_configure_tempurls
689+
fi
682690
}
683691

684692
# stop_swift() - Stop running processes (non-screen)
@@ -701,6 +709,13 @@ function stop_swift {
701709
pkill -f swift-
702710
}
703711

712+
function swift_configure_tempurls {
713+
OS_USERNAME=swift \
714+
OS_TENANT_NAME=$SERVICE_TENANT_NAME \
715+
OS_PASSWORD=$SERVICE_PASSWORD \
716+
swift post -m "Temp-URL-Key: $SWIFT_TEMPURL_KEY"
717+
}
718+
704719
# Restore xtrace
705720
$XTRACE
706721

stack.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,10 @@ if is_service_enabled s-proxy; then
474474
# ``SWIFT_HASH`` is a random unique string for a swift cluster that
475475
# can never change.
476476
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
477481
fi
478482

479483

0 commit comments

Comments
 (0)