Merge "Use NOVA_BIN_DIR / SWIFT_BIN_DIR for binaries"

This commit is contained in:
Zuul 2018-04-08 14:05:16 +00:00 committed by Gerrit Code Review
commit 935a89801b
2 changed files with 26 additions and 27 deletions

View File

@ -685,7 +685,7 @@ function init_nova_cells {
$NOVA_BIN_DIR/nova-manage cell create --name=child --cell_type=child --username=$RABBIT_USERID --hostname=$RABBIT_HOST --port=5672 --password=$RABBIT_PASSWORD --virtual_host=child_cell --woffset=0 --wscale=1 $NOVA_BIN_DIR/nova-manage cell create --name=child --cell_type=child --username=$RABBIT_USERID --hostname=$RABBIT_HOST --port=5672 --password=$RABBIT_PASSWORD --virtual_host=child_cell --woffset=0 --wscale=1
# Creates the single cells v2 cell for the child cell (v1) nova db. # Creates the single cells v2 cell for the child cell (v1) nova db.
nova-manage --config-file $NOVA_CELLS_CONF cell_v2 create_cell \ $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CELLS_CONF cell_v2 create_cell \
--transport-url $(get_transport_url child_cell) --name 'cell1' --transport-url $(get_transport_url child_cell) --name 'cell1'
fi fi
} }
@ -729,7 +729,7 @@ function init_nova {
# this needs to come after the api_db sync happens. We also want to run # this needs to come after the api_db sync happens. We also want to run
# this before the db sync below since that will migrate both the nova # this before the db sync below since that will migrate both the nova
# and nova_cell0 databases. # and nova_cell0 databases.
nova-manage cell_v2 map_cell0 --database_connection `database_connection_url nova_cell0` $NOVA_BIN_DIR/nova-manage cell_v2 map_cell0 --database_connection `database_connection_url nova_cell0`
# (Re)create nova databases # (Re)create nova databases
for i in $(seq 1 $NOVA_NUM_CELLS); do for i in $(seq 1 $NOVA_NUM_CELLS); do
@ -750,7 +750,7 @@ function init_nova {
# create the cell1 cell for the main nova db where the hosts live # create the cell1 cell for the main nova db where the hosts live
for i in $(seq 1 $NOVA_NUM_CELLS); do for i in $(seq 1 $NOVA_NUM_CELLS); do
nova-manage --config-file $NOVA_CONF --config-file $(conductor_conf $i) cell_v2 create_cell --name "cell$i" $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF --config-file $(conductor_conf $i) cell_v2 create_cell --name "cell$i"
done done
fi fi
@ -1015,7 +1015,7 @@ function start_nova {
if is_service_enabled n-api; then if is_service_enabled n-api; then
# dump the cell mapping to ensure life is good # dump the cell mapping to ensure life is good
echo "Dumping cells_v2 mapping" echo "Dumping cells_v2 mapping"
nova-manage cell_v2 list_cells --verbose $NOVA_BIN_DIR/nova-manage cell_v2 list_cells --verbose
fi fi
} }

View File

@ -37,6 +37,7 @@ fi
# Set up default directories # Set up default directories
GITDIR["python-swiftclient"]=$DEST/python-swiftclient GITDIR["python-swiftclient"]=$DEST/python-swiftclient
SWIFT_DIR=$DEST/swift
# Swift virtual environment # Swift virtual environment
if [[ ${USE_VENV} = True ]]; then if [[ ${USE_VENV} = True ]]; then
@ -46,8 +47,6 @@ else
SWIFT_BIN_DIR=$(get_python_exec_prefix) SWIFT_BIN_DIR=$(get_python_exec_prefix)
fi fi
SWIFT_DIR=$DEST/swift
SWIFT_AUTH_CACHE_DIR=${SWIFT_AUTH_CACHE_DIR:-/var/cache/swift} SWIFT_AUTH_CACHE_DIR=${SWIFT_AUTH_CACHE_DIR:-/var/cache/swift}
SWIFT_APACHE_WSGI_DIR=${SWIFT_APACHE_WSGI_DIR:-/var/www/swift} SWIFT_APACHE_WSGI_DIR=${SWIFT_APACHE_WSGI_DIR:-/var/www/swift}
SWIFT3_DIR=$DEST/swift3 SWIFT3_DIR=$DEST/swift3
@ -341,7 +340,7 @@ function configure_swift {
local user_group local user_group
# Make sure to kill all swift processes first # Make sure to kill all swift processes first
swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true $SWIFT_BIN_DIR/swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true
sudo install -d -o ${STACK_USER} ${SWIFT_CONF_DIR} sudo install -d -o ${STACK_USER} ${SWIFT_CONF_DIR}
sudo install -d -o ${STACK_USER} ${SWIFT_CONF_DIR}/{object,container,account}-server sudo install -d -o ${STACK_USER} ${SWIFT_CONF_DIR}/{object,container,account}-server
@ -704,7 +703,7 @@ function create_swift_accounts {
function init_swift { function init_swift {
local node_number local node_number
# Make sure to kill all swift processes first # Make sure to kill all swift processes first
swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true $SWIFT_BIN_DIR/swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true
# Forcibly re-create the backing filesystem # Forcibly re-create the backing filesystem
create_swift_disk create_swift_disk
@ -715,9 +714,9 @@ function init_swift {
rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz
swift-ring-builder object.builder create ${SWIFT_PARTITION_POWER_SIZE} ${SWIFT_REPLICAS} 1 $SWIFT_BIN_DIR/swift-ring-builder object.builder create ${SWIFT_PARTITION_POWER_SIZE} ${SWIFT_REPLICAS} 1
swift-ring-builder container.builder create ${SWIFT_PARTITION_POWER_SIZE} ${SWIFT_REPLICAS} 1 $SWIFT_BIN_DIR/swift-ring-builder container.builder create ${SWIFT_PARTITION_POWER_SIZE} ${SWIFT_REPLICAS} 1
swift-ring-builder account.builder create ${SWIFT_PARTITION_POWER_SIZE} ${SWIFT_REPLICAS} 1 $SWIFT_BIN_DIR/swift-ring-builder account.builder create ${SWIFT_PARTITION_POWER_SIZE} ${SWIFT_REPLICAS} 1
# The ring will be created on each node, and because the order of # The ring will be created on each node, and because the order of
# nodes is identical we can use a seed for rebalancing, making it # nodes is identical we can use a seed for rebalancing, making it
@ -728,26 +727,26 @@ function init_swift {
node_number=1 node_number=1
for node in ${SWIFT_STORAGE_IPS}; do for node in ${SWIFT_STORAGE_IPS}; do
swift-ring-builder object.builder add z${node_number}-${node}:${OBJECT_PORT_BASE}/sdb1 1 $SWIFT_BIN_DIR/swift-ring-builder object.builder add z${node_number}-${node}:${OBJECT_PORT_BASE}/sdb1 1
swift-ring-builder container.builder add z${node_number}-${node}:${CONTAINER_PORT_BASE}/sdb1 1 $SWIFT_BIN_DIR/swift-ring-builder container.builder add z${node_number}-${node}:${CONTAINER_PORT_BASE}/sdb1 1
swift-ring-builder account.builder add z${node_number}-${node}:${ACCOUNT_PORT_BASE}/sdb1 1 $SWIFT_BIN_DIR/swift-ring-builder account.builder add z${node_number}-${node}:${ACCOUNT_PORT_BASE}/sdb1 1
let "node_number=node_number+1" let "node_number=node_number+1"
done done
else else
for node_number in ${SWIFT_REPLICAS_SEQ}; do for node_number in ${SWIFT_REPLICAS_SEQ}; do
swift-ring-builder object.builder add z${node_number}-${SWIFT_SERVICE_LOCAL_HOST}:$(( OBJECT_PORT_BASE + 10 * (node_number - 1) ))/sdb1 1 $SWIFT_BIN_DIR/swift-ring-builder object.builder add z${node_number}-${SWIFT_SERVICE_LOCAL_HOST}:$(( OBJECT_PORT_BASE + 10 * (node_number - 1) ))/sdb1 1
swift-ring-builder container.builder add z${node_number}-${SWIFT_SERVICE_LOCAL_HOST}:$(( CONTAINER_PORT_BASE + 10 * (node_number - 1) ))/sdb1 1 $SWIFT_BIN_DIR/swift-ring-builder container.builder add z${node_number}-${SWIFT_SERVICE_LOCAL_HOST}:$(( CONTAINER_PORT_BASE + 10 * (node_number - 1) ))/sdb1 1
swift-ring-builder account.builder add z${node_number}-${SWIFT_SERVICE_LOCAL_HOST}:$(( ACCOUNT_PORT_BASE + 10 * (node_number - 1) ))/sdb1 1 $SWIFT_BIN_DIR/swift-ring-builder account.builder add z${node_number}-${SWIFT_SERVICE_LOCAL_HOST}:$(( ACCOUNT_PORT_BASE + 10 * (node_number - 1) ))/sdb1 1
done done
fi fi
# We use a seed for rebalancing. Doing this allows us to create # We use a seed for rebalancing. Doing this allows us to create
# identical rings on multiple nodes if SWIFT_STORAGE_IPS is the same # identical rings on multiple nodes if SWIFT_STORAGE_IPS is the same
swift-ring-builder object.builder rebalance 42 $SWIFT_BIN_DIR/swift-ring-builder object.builder rebalance 42
swift-ring-builder container.builder rebalance 42 $SWIFT_BIN_DIR/swift-ring-builder container.builder rebalance 42
swift-ring-builder account.builder rebalance 42 $SWIFT_BIN_DIR/swift-ring-builder account.builder rebalance 42
} && popd >/dev/null } && popd >/dev/null
# Create cache dir # Create cache dir
@ -803,7 +802,7 @@ function start_swift {
# Apache should serve the "PACO" a.k.a "main" services # Apache should serve the "PACO" a.k.a "main" services
restart_apache_server restart_apache_server
# The rest of the services should be started in backgroud # The rest of the services should be started in backgroud
swift-init --run-dir=${SWIFT_DATA_DIR}/run rest start $SWIFT_BIN_DIR/swift-init --run-dir=${SWIFT_DATA_DIR}/run rest start
return 0 return 0
fi fi
@ -827,7 +826,7 @@ function start_swift {
done done
if [[ "$SWIFT_START_ALL_SERVICES" == "True" ]]; then if [[ "$SWIFT_START_ALL_SERVICES" == "True" ]]; then
swift-init --run-dir=${SWIFT_DATA_DIR}/run rest start $SWIFT_BIN_DIR/swift-init --run-dir=${SWIFT_DATA_DIR}/run rest start
else else
# The container-sync daemon is strictly needed to pass the container # The container-sync daemon is strictly needed to pass the container
# sync Tempest tests. # sync Tempest tests.
@ -835,8 +834,8 @@ function start_swift {
run_process s-container-sync "$SWIFT_BIN_DIR/swift-container-sync ${SWIFT_CONF_DIR}/container-server/1.conf" run_process s-container-sync "$SWIFT_BIN_DIR/swift-container-sync ${SWIFT_CONF_DIR}/container-server/1.conf"
fi fi
else else
swift-init --run-dir=${SWIFT_DATA_DIR}/run all restart || true $SWIFT_BIN_DIR/swift-init --run-dir=${SWIFT_DATA_DIR}/run all restart || true
swift-init --run-dir=${SWIFT_DATA_DIR}/run proxy stop || true $SWIFT_BIN_DIR/swift-init --run-dir=${SWIFT_DATA_DIR}/run proxy stop || true
fi fi
if is_service_enabled tls-proxy; then if is_service_enabled tls-proxy; then
@ -863,12 +862,12 @@ function stop_swift {
local type local type
if [ "$SWIFT_USE_MOD_WSGI" == "True" ]; then if [ "$SWIFT_USE_MOD_WSGI" == "True" ]; then
swift-init --run-dir=${SWIFT_DATA_DIR}/run rest stop && return 0 $SWIFT_BIN_DIR/swift-init --run-dir=${SWIFT_DATA_DIR}/run rest stop && return 0
fi fi
# screen normally killed by ``unstack.sh`` # screen normally killed by ``unstack.sh``
if type -p swift-init >/dev/null; then if type -p $SWIFT_BIN_DIR/swift-init >/dev/null; then
swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true $SWIFT_BIN_DIR/swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true
fi fi
# Dump all of the servers # Dump all of the servers
# Maintain the iteration as stop_process() has some desirable side-effects # Maintain the iteration as stop_process() has some desirable side-effects