Sam Yaple 77800984bc Refactor set_configs.py
This refactor brings the logging in line with the rest of Kolla.
The fucntion names were updated to reflect thier new role.

Additionally, it fixes several issues with the permissions which
currently break all containers that use set_configs.py

It will also work with source being a directory or a file now.

Change-Id: I4a197a343e3baf3bd31532debdff5972adb8aefa
Partially-Implements: blueprint replace-config-external
2015-09-17 20:10:58 +00:00

29 lines
606 B
Bash
Executable File

#!/bin/bash
set -o errexit
# Loading common functions
source /opt/kolla/kolla-common.sh
# Generate run command
python /opt/kolla/set_configs.py
CMD=$(cat /run_command)
# Loading functions
source /opt/kolla/config/config-galera.sh
chown mysql: /var/lib/mysql
# This catches all cases of the BOOTSTRAP variable being set, including empty
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
ARGS="--wsrep-new-cluster"
touch /var/lib/mysql/cluster.exists
populate_db
bootstrap_db
exec $CMD $ARGS
exit 0
fi
echo "Running command: ${CMD}"
exec $CMD