switch from sample_config.sh to oslo-config-generator
This switches keystone to use oslo-config-generator, where the contents of our sample configuration file are configured using a configuration file in config-generators/, because the only way to have tox create files is to have configuration files for your configuration files (seriously, it chokes when redirects are included in the command for a test environment). This also takes advantage of oslo-config-generator's ability to set the line wrap width, which is done at 79 chars here to match the rest of our code. Also update the actual sample file under etc/ Change-Id: I9f9a157c7802c56a2c7484f6f4adec4aeb4071b8 Closes-Bug: 1324610changes/05/113905/17
parent
f5c06d619c
commit
083d1cd522
@ -0,0 +1,10 @@
|
||||
[DEFAULT]
|
||||
output_file = etc/keystone.conf.sample
|
||||
wrap_width = 79
|
||||
namespace = keystone
|
||||
namespace = keystone.notifications
|
||||
namespace = keystone.openstack.common.eventlet_backdoor
|
||||
namespace = keystone.openstack.common.log
|
||||
namespace = keystone.openstack.common.policy
|
||||
namespace = oslo.messaging
|
||||
namespace = oslo.db
|
File diff suppressed because it is too large
Load Diff
@ -1,38 +0,0 @@
|
||||
This generate_sample.sh tool is used to generate sample config files
|
||||
from OpenStack project source trees.
|
||||
|
||||
Run it by passing the base directory and package name i.e.
|
||||
|
||||
$> generate_sample.sh --base-dir /opt/stack/nova --package-name nova \
|
||||
--output-dir /opt/stack/nova/etc
|
||||
$> generate_sample.sh -b /opt/stack/neutron -p nova -o /opt/stack/neutron/etc
|
||||
|
||||
Optionally, include libraries that register entry points for option
|
||||
discovery, such as oslo.messaging:
|
||||
|
||||
$> generate_sample.sh -b /opt/stack/ceilometer -p ceilometer \
|
||||
-o /opt/stack/ceilometer/etc -l oslo.messaging
|
||||
|
||||
Watch out for warnings about modules like libvirt, qpid and zmq not
|
||||
being found - these warnings are significant because they result
|
||||
in options not appearing in the generated config file.
|
||||
|
||||
|
||||
|
||||
This check_uptodate.sh tool is used to ensure that the generated sample
|
||||
config file in the OpenStack project source tree is continually kept up
|
||||
to date with the code itself.
|
||||
|
||||
This can be done by adding a hook to tox.ini. For example, if a project
|
||||
already had flake8 enabled in a section like this:
|
||||
|
||||
[testenv.pep8]
|
||||
commands =
|
||||
flake8 {posargs}
|
||||
|
||||
This section would be changed to:
|
||||
|
||||
[testenv.pep8]
|
||||
commands =
|
||||
flake8 {posargs}
|
||||
{toxinidir}/tools/config/check_uptodate.sh
|
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PROJECT_NAME=${PROJECT_NAME:-keystone}
|
||||
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 [ $? != 0 ]
|
||||
then
|
||||
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 ${0%%${0##*/}}generate_sample.sh."
|
||||
exit 1
|
||||
fi
|
@ -1,4 +0,0 @@
|
||||
# Environmental Variables that affect the automatic sample config generation.
|
||||
# Additions to any of these variables are space delimited. See the "generate_sample.sh"
|
||||
# script for the variables that can be used.
|
||||
KEYSTONE_CONFIG_GENERATOR_EXTRA_LIBRARIES='keystone oslo.messaging oslo.db'
|
Loading…
Reference in New Issue