# swift-init has a bug using /etc/swift until bug #885595 is fixed
# we have to create a link
sudo ln -s ${SWIFT_CONFIG_LOCATION} /etc/swift
# Swift use rsync to syncronize between all the different
# Swift use rsync to syncronize between all the different
# partitions (which make more sense when you have a multi-node
# partitions (which make more sense when you have a multi-node
# setup) we configure it with our version of rsync.
# setup) we configure it with our version of rsync.
@ -699,10 +710,10 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
# We do the install of the proxy-server and swift configuration
# We do the install of the proxy-server and swift configuration
# replacing a few directives to match our configuration.
# replacing a few directives to match our configuration.
sed "s/%USER%/$USER/;s/%SERVICE_TOKEN%/${SERVICE_TOKEN}/;s/%AUTH_SERVER%/${swift_auth_server}/"\
sed "s,%SWIFT_CONFIG_LOCATION%,${SWIFT_CONFIG_LOCATION},;s/%USER%/$USER/;s/%SERVICE_TOKEN%/${SERVICE_TOKEN}/;s/%AUTH_SERVER%/${swift_auth_server}/"\
$FILES/swift/proxy-server.conf|sudo tee /etc/swift/proxy-server.conf
$FILES/swift/proxy-server.conf|sudo tee ${SWIFT_CONFIG_LOCATION}/proxy-server.conf
sed -e "s/%SWIFT_HASH%/$SWIFT_HASH/"$FILES/swift/swift.conf > /etc/swift/swift.conf
sed -e "s/%SWIFT_HASH%/$SWIFT_HASH/"$FILES/swift/swift.conf > ${SWIFT_CONFIG_LOCATION}/swift.conf
# We need to generate a object/account/proxy configuration
# We need to generate a object/account/proxy configuration
# emulating 4 nodes on different ports we have a little function
# emulating 4 nodes on different ports we have a little function
@ -715,8 +726,8 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
for node_number in {1..4};do
for node_number in {1..4};do
node_path=${SWIFT_DATA_LOCATION}/${node_number}
node_path=${SWIFT_DATA_LOCATION}/${node_number}
sed -e "s,%USER%,$USER,;s,%NODE_PATH%,${node_path},;s,%BIND_PORT%,${bind_port},;s,%LOG_FACILITY%,${log_facility},"\
sed -e "s,%SWIFT_CONFIG_LOCATION%,${SWIFT_CONFIG_LOCATION},;s,%USER%,$USER,;s,%NODE_PATH%,${node_path},;s,%BIND_PORT%,${bind_port},;s,%LOG_FACILITY%,${log_facility},"\
@ -732,7 +743,7 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
# - swift-startmain
# - swift-startmain
# Restart your full cluster.
# Restart your full cluster.
#
#
sed -e "s/%SWIFT_PARTITION_POWER_SIZE%/$SWIFT_PARTITION_POWER_SIZE/"$FILES/swift/swift-remakerings |\
sed -e "s,%SWIFT_CONFIG_LOCATION%,${SWIFT_CONFIG_LOCATION},;s/%SWIFT_PARTITION_POWER_SIZE%/$SWIFT_PARTITION_POWER_SIZE/"$FILES/swift/swift-remakerings |\