Cap bashate and fix linters tests

Bashate is pinned to ensure that for the rest of the cycle, and
once this becomes a stable branch, there are no code changes
needed for updates to the linting tool.

Also, the tox configuration is updated to ensure that it consumes
the dev-requirements file for all lint testing.

Finally, a small pep8 failure is fixed in the dynamic inventory script.

Change-Id: I78056d1d22228f073c44e9ee4e78534a4010effe
This commit is contained in:
Jesse Pretorius 2016-03-07 17:36:30 +00:00
parent 4ebf7974ef
commit 13bea32989
3 changed files with 6 additions and 23 deletions

View File

@ -857,7 +857,7 @@ def _extra_config(user_defined_config, base_dir):
def _check_config_settings(cidr_networks, config, container_skel):
""" check preciseness of config settings
"""check preciseness of config settings
:param cidr_networks: ``dict`` cidr_networks from config
:param config: ``dict`` User defined information

View File

@ -1,10 +1,11 @@
ansible-lint>=2.0.3
ansible>1.9,<2.0
ansible-lint>=2.0.3,<=2.3.6
bashate==0.5.0 # Apache-2.0
flake8==2.2.4
hacking>=0.10.0,<0.11
mccabe==0.2.1 # capped for flake8
pep8==1.5.7
pyflakes==0.8.1
mccabe==0.2.1 # capped for flake8
bashate>=0.2 # Apache-2.0
# this is required for the docs build jobs
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2

20
tox.ini
View File

@ -8,6 +8,7 @@ usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = bash
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@ -23,8 +24,6 @@ commands = {posargs}
# Run hacking/flake8 check for all python files
[testenv:pep8]
deps = flake8
whitelist_externals = bash
commands =
bash -c "grep -Irl \
-e '!/usr/bin/env python' \
@ -48,9 +47,6 @@ commands =
ignore=F403,H303
[testenv:bashate]
deps =
bashate
whitelist_externals = bash
commands =
# Run bashate check for all bash scripts
# Ignores the following rules:
@ -67,18 +63,11 @@ commands =
{toxinidir} | xargs bashate --error . --verbose --ignore=E003,E006,E040"
[testenv:ansible-lint]
deps =
ansible>1.9,<2.0
ansible-lint
whitelist_externals = bash
commands =
# Perform an Ansible lint check
bash -c "ansible-lint {toxinidir}/playbooks/*.yml"
[testenv:ansible-syntax]
deps =
ansible>1.9,<2.0
whitelist_externals = bash
commands =
# Perform an Ansible syntax check
bash -c "mkdir -p {envtmpdir}/ansible; \
@ -101,13 +90,6 @@ commands =
{toxinidir}/playbooks/*.yml"
[testenv:linters]
deps =
{[testenv:pep8]deps}
{[testenv:bashate]deps}
{[testenv:ansible-lint]deps}
# note that the ansible-syntax deps are omitted on purpose as the
# ansible-lint env contains duplicate items in its dep list
whitelist_externals = bash
commands =
{[testenv:pep8]commands}
{[testenv:bashate]commands}