e9d03ee1ea
Use config tools from Oslo-incubator : * generate a consistant config file sample: etc/climate/climate.conf.sample * Add a new check in tox env 'pep8' to check out-dated config file sample. Move specifics options for admin credential in group config 'physical:host' Factorize by declaring config options in each plugins with available values and centralizing RESOURCE_TYPE value in plugin's module (one dir per plugin) Use socket.gethostname() in place of socket.getfqdn() to have predictable default value for 'host' config in climate.config, since it's ugly forced in openstack.common.config.generator#L232 Fixes: bug #1271875 Change-Id: Ie54fc98b58b49400360c4fd2ce7d8bb3b75915e2
26 lines
687 B
Bash
Executable File
26 lines
687 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
PROJECT_NAME=${PROJECT_NAME:-climate}
|
|
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
|