Stop gating on sample generation check

This removes the check on in tree sample generation to ensure the file
matches the config options. However, to counter the loss of the in-tree
the tempest init command will now automatically generate a new sample
config in the local etc dir when run. This will include all of the oslo
options that were previously included in the in-tree sample file.
Additionally, the docs now contain the complete text of the generated
sample output. These also get published on docs.openstack.org on each
commit to tempest. Between this 2 alternatives there shouldn't be a need
to keep the file in tree anymore, especially given the weekly headaches
with new oslo releases changing the config option help breaking the job.

Change-Id: Ie3bc368329d240ca9604cc2f9b2cac544b3ee715
Depends-On: I4064a041a965ed2419b68efc8dc31fce37b24cfd
This commit is contained in:
Matthew Treinish 2015-07-27 17:07:37 -04:00
parent b389faa22f
commit c8a39b488b
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
5 changed files with 8 additions and 1273 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@ AUTHORS
ChangeLog ChangeLog
*.pyc *.pyc
etc/tempest.conf etc/tempest.conf
etc/tempest.conf.sample
etc/logging.conf etc/logging.conf
include/swift_objects/swift_small include/swift_objects/swift_small
include/swift_objects/swift_medium include/swift_objects/swift_medium

File diff suppressed because it is too large Load Diff

View File

@ -67,6 +67,11 @@ class TempestInit(command.Command):
def copy_config(self, etc_dir, config_dir): def copy_config(self, etc_dir, config_dir):
shutil.copytree(config_dir, etc_dir) shutil.copytree(config_dir, etc_dir)
def generate_sample_config(self, local_dir):
subprocess.call(['oslo-config-generator', '--config-file',
'tools/config/config-generator.tempest.conf'],
cwd=local_dir)
def create_working_dir(self, local_dir, config_dir): def create_working_dir(self, local_dir, config_dir):
# Create local dir if missing # Create local dir if missing
if not os.path.isdir(local_dir): if not os.path.isdir(local_dir):
@ -87,6 +92,8 @@ class TempestInit(command.Command):
os.mkdir(log_dir) os.mkdir(log_dir)
# Create and copy local etc dir # Create and copy local etc dir
self.copy_config(etc_dir, config_dir) self.copy_config(etc_dir, config_dir)
# Generate the sample config file
self.generate_sample_config(local_dir)
# Update local confs to reflect local paths # Update local confs to reflect local paths
self.update_local_conf(config_path, lock_dir, log_dir) self.update_local_conf(config_path, lock_dir, log_dir)
# Generate a testr conf file # Generate a testr conf file

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
PROJECT_NAME=${PROJECT_NAME:-tempest}
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
oslo-config-generator --config-file tools/config/config-generator.tempest.conf --output-file ${TEMPDIR}/${CFGFILE_NAME}
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 tox -egenconfig."
exit 1
fi

View File

@ -116,7 +116,6 @@ commands =
[testenv:pep8] [testenv:pep8]
commands = commands =
flake8 {posargs} flake8 {posargs}
{toxinidir}/tools/config/check_uptodate.sh
python tools/check_uuid.py python tools/check_uuid.py
[testenv:uuidgen] [testenv:uuidgen]