Move bandit into pep8

Run security linter bandit as part of pep8. Pep8 is the usual linter
target and thus let's use it there instead of starting another node
for this short-running job.

Also reduced the lines of context from 5 to 3 since it shouldn't
matter to most.

Change-Id: I54a4fccebb375517f9cd129f62f8f0c795b6edcc
This commit is contained in:
Eric Brown 2016-02-24 13:34:25 -08:00
parent 7e649b2223
commit fa93ed4972
2 changed files with 7 additions and 3 deletions

View File

@ -310,7 +310,8 @@ class DatastoreURL(object):
if self._scheme == 'http':
conn = httplib.HTTPConnection(self._server)
elif self._scheme == 'https':
conn = httplib.HTTPSConnection(self._server)
# TODO(browne): This needs to be changed to use python requests
conn = httplib.HTTPSConnection(self._server) # nosec
else:
excep_msg = _("Invalid scheme: %s.") % self._scheme
LOG.error(excep_msg)

View File

@ -6,7 +6,10 @@ deps = -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
[testenv:pep8]
commands = flake8
commands =
flake8
# Run security linter
bandit -r oslo_vmware
[testenv:pylint]
deps = -r{toxinidir}/test-requirements.txt
@ -15,7 +18,7 @@ commands = pylint oslo
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r oslo_vmware -n 5
commands = bandit -r oslo_vmware
[testenv:docs]
commands = python setup.py build_sphinx