cinder/tools/config/check_uptodate.sh
Sean McGinnis fcd7fcea3e Add sample config file to cinder docs
The oslo sphinxconfiggen module was added to the oslo.config
2.3.0 release. This enables config file generation as part of
the sphinx doc generation.

The generated config file will pick up the current config
options from the code base. And as an added bonus, it will
now be published to the docs.openstack.org site for easy
reference or download.

This also puts us inline with what other projects like Nova
are doing for sample config files and is the recommended
method from the Oslo team.

Change-Id: I912a97eb2686d3dc56e50d8641d7bd930179bc18
2016-05-17 08:52:21 -05:00

35 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
if [ ! -e cinder/opts.py ]; then
echo -en "\n\n#################################################"
echo -en "\nERROR: cinder/opts.py file is missing."
echo -en "\n#################################################\n"
exit 1
else
mv cinder/opts.py cinder/opts.py.orig
tox -e genopts &> /dev/null
if [ $? -ne 0 ]; then
echo -en "\n\n#################################################"
echo -en "\nERROR: Non-zero exit from generate_cinder_opts.py."
echo -en "\n See output above for details.\n"
echo -en "#################################################\n"
mv cinder/opts.py.orig cinder/opts.py
exit 1
else
diff cinder/opts.py.orig cinder/opts.py
if [ $? -ne 0 ]; then
echo -en "\n\n########################################################"
echo -en "\nERROR: Configuration options change detected."
echo -en "\n A new cinder/opts.py file must be generated."
echo -en "\n Run 'tox -e genopts' from the base directory"
echo -en "\n and add the result to your commit."
echo -en "\n########################################################\n\n"
rm cinder/opts.py
mv cinder/opts.py.orig cinder/opts.py
exit 1
else
rm cinder/opts.py.orig
fi
fi
fi