From fa93ed497285e94d4b0a049029277f36b13a4cbc Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Wed, 24 Feb 2016 13:34:25 -0800 Subject: [PATCH] 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 --- oslo_vmware/objects/datastore.py | 3 ++- tox.ini | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/oslo_vmware/objects/datastore.py b/oslo_vmware/objects/datastore.py index 87e7c91..9816215 100644 --- a/oslo_vmware/objects/datastore.py +++ b/oslo_vmware/objects/datastore.py @@ -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) diff --git a/tox.ini b/tox.ini index 70e313d..a310220 100644 --- a/tox.ini +++ b/tox.ini @@ -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