Matthew Treinish | 90ac914 | 2014-03-17 14:58:37 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | PROJECT_NAME=${PROJECT_NAME:-tempest} |
| 4 | CFGFILE_NAME=${PROJECT_NAME}.conf.sample |
| 5 | |
| 6 | if [ -e etc/${PROJECT_NAME}/${CFGFILE_NAME} ]; then |
| 7 | CFGFILE=etc/${PROJECT_NAME}/${CFGFILE_NAME} |
| 8 | elif [ -e etc/${CFGFILE_NAME} ]; then |
| 9 | CFGFILE=etc/${CFGFILE_NAME} |
| 10 | else |
| 11 | echo "${0##*/}: can not find config file" |
| 12 | exit 1 |
| 13 | fi |
| 14 | |
| 15 | TEMPDIR=`mktemp -d /tmp/${PROJECT_NAME}.XXXXXX` |
| 16 | trap "rm -rf $TEMPDIR" EXIT |
| 17 | |
Jon Grimm | 270bd7f | 2014-08-05 18:11:29 +0000 | [diff] [blame^] | 18 | oslo-config-generator --config-file tools/config/config-generator.tempest.conf --output-file ${TEMPDIR}/${CFGFILE_NAME} |
Matthew Treinish | 4251685 | 2014-06-19 10:51:29 -0400 | [diff] [blame] | 19 | if [ $? != 0 ] |
| 20 | then |
| 21 | exit 1 |
| 22 | fi |
Matthew Treinish | 90ac914 | 2014-03-17 14:58:37 +0000 | [diff] [blame] | 23 | |
| 24 | if ! diff -u ${TEMPDIR}/${CFGFILE_NAME} ${CFGFILE} |
Matthew Treinish | 3d46811 | 2013-10-24 21:49:14 +0000 | [diff] [blame] | 25 | then |
Matthew Treinish | 90ac914 | 2014-03-17 14:58:37 +0000 | [diff] [blame] | 26 | echo "${0##*/}: ${PROJECT_NAME}.conf.sample is not up to date." |
Jon Grimm | 270bd7f | 2014-08-05 18:11:29 +0000 | [diff] [blame^] | 27 | echo "${0##*/}: Please run tox -egenconfig." |
Matthew Treinish | 90ac914 | 2014-03-17 14:58:37 +0000 | [diff] [blame] | 28 | exit 1 |
Matthew Treinish | 3d46811 | 2013-10-24 21:49:14 +0000 | [diff] [blame] | 29 | fi |