819f28a0b8
As a common approach most projects used now and Oslo preferred, this change enabled sample configuration file generation mechanism for each Glance services. This change, as an enhancement, allows generating separated sample configuration files for each Glance major services, e.g.: etc/glance-api.conf.sample etc/glance-cache.conf.sample etc/glance-manage.conf.sample etc/glance-registry.conf.sample etc/glance-scrubber.conf.sample It is different than I94d486d6686815c45705a7a9b00fb26062e1eb63 which only supports generating an unified sample configuration file to including all Glance available options. This mechanism not only can help auditing by packager, milestone maintainer or developer as a function (testenv) of tox, but also those separated configuration files could make deployment be easy. And it helps keeping sample configuration files be update with code change. The change added "genconfigs" function as a tox testenv (-egenconfigs), and it dependes on oslo-config-generator function of oslo.config. The change doesn't introduce those sample files Glance repo, so next step is to investigate if we can generate them in gate automatically when a change was merged. Related-Change-Id: I15686708fc9460948a58cfea3d18dae40ba1fda9 Related-Change-Id: Iae31856d5886ee78786972d80c7c103c3460a2b3 Related-Change-Id: I76043b08e2872867e5af2a5ac902e4d092fda5c8 Closes-Bug: #1300546 Closes-Bug: #1361963 Change-Id: Ibe03a3fe80b96ca32acb1a6bea7e38e6075951bb Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
53 lines
1.8 KiB
INI
53 lines
1.8 KiB
INI
[tox]
|
|
minversion = 1.6
|
|
envlist = py26,py27,py33,pep8
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
usedevelop = True
|
|
install_command = pip install --allow-all-external --allow-insecure netaddr -U {opts} {packages}
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands = python -m glance.openstack.common.lockutils python setup.py test --slowest \
|
|
--testr-args='--concurrency 1 {posargs}'
|
|
whitelist_externals = bash
|
|
|
|
[tox:jenkins]
|
|
downloadcache = ~/cache/pip
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
flake8 {posargs}
|
|
# Check that .po and .pot files are valid:
|
|
bash -c "find glance -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
|
|
|
|
[testenv:cover]
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
commands = python setup.py testr --coverage --testr-args='^(?!.*test.*coverage).*$'
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:genconfig]
|
|
commands =
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-api.conf
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-registry.conf
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-scrubber.conf
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-cache.conf
|
|
oslo-config-generator --config-file etc/oslo-config-generator/glance-manage.conf
|
|
|
|
[flake8]
|
|
# TODO(dmllr): Analyze or fix the warnings blacklisted below
|
|
# E711 comparison to None should be 'if cond is not None:'
|
|
# E712 comparison to True should be 'if cond is True:' or 'if cond:'
|
|
# H302 import only modules
|
|
# H402 one line docstring needs punctuation.
|
|
# H404 multi line docstring should start with a summary
|
|
ignore = E711,E712,H302,H402,H404
|
|
builtins = _
|
|
exclude = .venv,.git,.tox,dist,doc,etc,*glance/locale*,*openstack/common*,*lib/python*,*egg,build
|
|
|
|
[hacking]
|
|
local-check-factory = glance.hacking.checks.factory
|