deb-mistral/tools/config/check_uptodate.sh
Nikolay Mahotkin f34edb7e27 Make mistral use of oslo-config-generator
Change-Id: I01f36e4b0080e10b9d39a6adbfe4b6cd43957fc6
2015-05-26 13:06:09 +03:00

26 lines
720 B
Bash
Executable File

#!/usr/bin/env bash
PROJECT_NAME=${PROJECT_NAME:-mistral}
CFGFILE_NAME=${PROJECT_NAME}.conf.sample
if [ -e etc/${PROJECT_NAME}/${CFGFILE_NAME} ]; then
CFGFILE=etc/${PROJECT_NAME}/${CFGFILE_NAME}
elif [ -e etc/${CFGFILE_NAME} ]; then
CFGFILE=etc/${CFGFILE_NAME}
else
echo "${0##*/}: can not find config file"
exit 1
fi
TEMPDIR=$(mktemp -d /tmp/${PROJECT_NAME}.XXXXXX)
trap "rm -rf $TEMPDIR" EXIT
oslo-config-generator --config-file tools/config/config-generator.mistral.conf --output-file ${TEMPDIR}/${CFGFILE_NAME}
if ! diff -u ${TEMPDIR}/${CFGFILE_NAME} ${CFGFILE}
then
echo "${0##*/}: ${PROJECT_NAME}.conf.sample is not up to date."
echo "${0##*/}: Please run tox -egenconfig."
exit 1
fi