nova/tools/config/check_uptodate.sh
Mark McLoughlin 6fd09137f8 Sync latest config file generator from oslo-incubator
Commits included:

  e3dddd7 generator: use EXTRA_* env vars in the bash script
  e8e636c generator: add an EXTRA_LIBRARIES env variable
  6da13e8 generator: rename EXTRA_MODULES_FILE to RC_FILE
  5dce17b Use entry points to discover options in libraries
  dd9aa2b Remove unused variables
  ad17a69 Fix filter() usage due to python 3 compability
  343686b Add check_uptodate to tools/config

The library option discovery support is the main addition we're
interested in since it is required for oslo.messaging.

Change-Id: I68958ddd1c1d0c02b54002c36b97270efaaaa892
2014-01-31 22:03:01 +00:00

26 lines
684 B
Bash
Executable File

#!/usr/bin/env bash
PROJECT_NAME=${PROJECT_NAME:-nova}
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
tools/config/generate_sample.sh -b ./ -p ${PROJECT_NAME} -o ${TEMPDIR}
if ! diff -u ${TEMPDIR}/${CFGFILE_NAME} ${CFGFILE}
then
echo "${0##*/}: ${PROJECT_NAME}.conf.sample is not up to date."
echo "${0##*/}: Please run ${0%%${0##*/}}generate_sample.sh."
exit 1
fi