ironic-python-agent/tools/config/check_uptodate.sh
Pavlo Shchelokovskyy 762f3bf4e6 Use oslo-config-generator for sample config
The old generate_sample.sh is broken already as it refers to
non-existing openstack/common path.

Let's use oslo-config-generator as many other OpenStack projects do.

Also, where applicable, option descriptions are updated with the
corresponding kernel parameters to set those options durig pxe boot.

Change-Id: Id4a0df30ea573d52f3b359f357fe8f4a29751939
2016-12-09 21:01:02 +02:00

30 lines
1015 B
Bash
Executable File

#!/usr/bin/env bash
PROJECT_NAME=${PROJECT_NAME:-ironic_python_agent}
CFGFILE_NAME=${PROJECT_NAME}.conf.sample
OSLO_CFGFILE_OPTION=${OSLO_CFGFILE_OPTION:-tools/config/ipa-config-generator.conf}
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=${OSLO_CFGFILE_OPTION} --output-file ${TEMPDIR}/${CFGFILE_NAME}
if [ $? != 0 ]; then
echo "oslo-config-generator failed to create a sample config file ${TEMPDIR}/${CFGFILE_NAME} with --config-file ${OSLO_CFGFILE_OPTION}"
exit 1
fi
if ! diff -u ${TEMPDIR}/${CFGFILE_NAME} ${CFGFILE}; then
echo "${0##*/}: ${PROJECT_NAME}.conf.sample is not up to date."
echo "${0##*/}: Please run oslo-config-generator --config-file=${OSLO_CFGFILE_OPTION}"
exit 1
fi