blob: 7b08695c8feb2944e05a6f41db4e454bfa6fa505 [file] [log] [blame]
Matthew Treinish90ac9142014-03-17 14:58:37 +00001#!/usr/bin/env bash
2
3PROJECT_NAME=${PROJECT_NAME:-tempest}
4CFGFILE_NAME=${PROJECT_NAME}.conf.sample
5
6if [ -e etc/${PROJECT_NAME}/${CFGFILE_NAME} ]; then
7 CFGFILE=etc/${PROJECT_NAME}/${CFGFILE_NAME}
8elif [ -e etc/${CFGFILE_NAME} ]; then
9 CFGFILE=etc/${CFGFILE_NAME}
10else
11 echo "${0##*/}: can not find config file"
12 exit 1
13fi
14
15TEMPDIR=`mktemp -d /tmp/${PROJECT_NAME}.XXXXXX`
16trap "rm -rf $TEMPDIR" EXIT
17
Jon Grimm270bd7f2014-08-05 18:11:29 +000018oslo-config-generator --config-file tools/config/config-generator.tempest.conf --output-file ${TEMPDIR}/${CFGFILE_NAME}
Matthew Treinish42516852014-06-19 10:51:29 -040019if [ $? != 0 ]
20then
21 exit 1
22fi
Matthew Treinish90ac9142014-03-17 14:58:37 +000023
24if ! diff -u ${TEMPDIR}/${CFGFILE_NAME} ${CFGFILE}
Matthew Treinish3d468112013-10-24 21:49:14 +000025then
Matthew Treinish90ac9142014-03-17 14:58:37 +000026 echo "${0##*/}: ${PROJECT_NAME}.conf.sample is not up to date."
Jon Grimm270bd7f2014-08-05 18:11:29 +000027 echo "${0##*/}: Please run tox -egenconfig."
Matthew Treinish90ac9142014-03-17 14:58:37 +000028 exit 1
Matthew Treinish3d468112013-10-24 21:49:14 +000029fi