update hacking and bandit

This patch updates hacking and bandit versions to match what neutron
and others are doing. It also fixes and ignores some new pep8 errors
that crop up due to the version bump. Finally the doc requirements are
moved to doc/requirements.txt to match what other projects do, even
though this project does not build docs today.

Change-Id: Ibe07dbdbaccc220b5ea2a628d342a09a01b09d11
This commit is contained in:
Boden R 2019-05-30 08:58:58 -06:00
parent 75506f4baf
commit 54d04d4fe1
7 changed files with 50 additions and 38 deletions

9
doc/requirements.txt Normal file
View File

@ -0,0 +1,9 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
oslosphinx>=4.7.0 # Apache-2.0
openstackdocstheme>=1.18.1 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0

View File

@ -3,10 +3,12 @@ coverage==4.0
decorator==4.3.0
eventlet==0.24.1
fixtures==3.0.0
flake8==2.6.2
flake8-import-order==0.12
hacking==0.12.0
hacking>=1.1.0 # Apache-2.0
mock==2.0.0
netaddr==0.7.18
openstackdocstheme==1.18.1
oslo.i18n==3.15.3
oslo.log==3.36.0
oslo.serialization==2.28.1
@ -20,7 +22,7 @@ pylint==1.7.1
reno==2.5.0
requests-mock==1.2.0
six==1.10.0
Sphinx==1.6.5
sphinx==1.6.5
stestr==1.0.0
tempest==17.1.0
tenacity==4.9.0

View File

@ -2,21 +2,19 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
hacking>=1.1.0 # Apache-2.0
bandit!=1.6.0,>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.00
fixtures>=3.0.0 # Apache-2.0/BSD
flake8-import-order==0.12 # LGPLv3
mock>=2.0.0 # BSD
python-subunit>=1.0.0 # Apache-2.0/BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD
oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testresources>=2.0.0 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
testscenarios>=0.4 # Apache-2.0/BSD
reno>=2.5.0 # Apache-2.0
bandit>=1.1.0 # Apache-2.0
tempest>=17.1.0 # Apache-2.0
pylint==1.7.6 # GPLv2
requests-mock>=1.2.0 # Apache-2.0

11
tox.ini
View File

@ -80,17 +80,21 @@ commands = {posargs}
[testenv:docs]
basepython = python3
commands = sphinx-build -W -b html doc/source doc/build/html
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -b html doc/source doc/build/html
[flake8]
# E125 continuation line does not distinguish itself from next logical line
# E129 visually indented line with same indent as next logical line
# E741 ambiguous variable name
# N530 direct neutron imports not allowed
# W504 line break after binary operator
# N531 translations hints
ignore = N530,E125,E129,N531
ignore = N530,E125,E129,E741,N531,W504
show-source = true
builtins = _
exclude = build,dist
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject
import-order-style = pep8
[hacking]
@ -108,4 +112,5 @@ basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
-r{toxinidir}/requirements.txt

View File

@ -161,11 +161,10 @@ class TestClientSslProfile(nsxlib_testcase.NsxClientTestCase):
'tags': consts.FAKE_TAGS
}
with mock.patch.object(self.nsxlib.client, 'create') as create:
self.nsxlib.load_balancer.client_ssl_profile.create(
body['display_name'], body['description'],
consts.FAKE_TAGS)
create.assert_called_with('loadbalancer/client-ssl-profiles',
body)
self.nsxlib.load_balancer.client_ssl_profile.create(
body['display_name'], body['description'],
consts.FAKE_TAGS)
create.assert_called_with('loadbalancer/client-ssl-profiles', body)
def test_list_client_ssl_profiles(self):
with mock.patch.object(self.nsxlib.client, 'list') as list_call:
@ -200,11 +199,10 @@ class TestServerSslProfile(nsxlib_testcase.NsxClientTestCase):
'tags': consts.FAKE_TAGS
}
with mock.patch.object(self.nsxlib.client, 'create') as create:
self.nsxlib.load_balancer.server_ssl_profile.create(
body['display_name'], body['description'],
consts.FAKE_TAGS)
create.assert_called_with('loadbalancer/server-ssl-profiles',
body)
self.nsxlib.load_balancer.server_ssl_profile.create(
body['display_name'], body['description'],
consts.FAKE_TAGS)
create.assert_called_with('loadbalancer/server-ssl-profiles', body)
def test_list_server_ssl_profiles(self):
with mock.patch.object(self.nsxlib.client, 'list') as list_call:
@ -278,11 +276,11 @@ class TestPool(nsxlib_testcase.NsxClientTestCase):
'tags': consts.FAKE_TAGS
}
with mock.patch.object(self.nsxlib.client, 'create') as create:
self.nsxlib.load_balancer.pool.create(
body['display_name'], body['description'],
consts.FAKE_TAGS, algorithm=body['algorithm'])
create.assert_called_with('loadbalancer/pools',
body)
self.nsxlib.load_balancer.pool.create(
body['display_name'], body['description'],
consts.FAKE_TAGS, algorithm=body['algorithm'])
create.assert_called_with('loadbalancer/pools',
body)
def test_list_pools(self):
with mock.patch.object(self.nsxlib.client, 'list') as list_call:
@ -359,12 +357,12 @@ class TestVirtualServer(nsxlib_testcase.NsxClientTestCase):
'tags': consts.FAKE_TAGS
}
with mock.patch.object(self.nsxlib.client, 'create') as create:
self.nsxlib.load_balancer.virtual_server.create(
body['display_name'], body['description'],
consts.FAKE_TAGS, ip_protocol=body['ip_protocol'],
port=body['port'], enabled=body['enabled'])
create.assert_called_with('loadbalancer/virtual-servers',
body)
self.nsxlib.load_balancer.virtual_server.create(
body['display_name'], body['description'],
consts.FAKE_TAGS, ip_protocol=body['ip_protocol'],
port=body['port'], enabled=body['enabled'])
create.assert_called_with('loadbalancer/virtual-servers',
body)
def test_list_virtual_servers(self):
with mock.patch.object(self.nsxlib.client, 'list') as list_call:
@ -503,12 +501,12 @@ class TestService(nsxlib_testcase.NsxClientTestCase):
'tags': consts.FAKE_TAGS
}
with mock.patch.object(self.nsxlib.client, 'create') as create:
self.nsxlib.load_balancer.service.create(
body['display_name'], body['description'],
consts.FAKE_TAGS, enabled=body['enabled'],
attachment=body['attachment'])
create.assert_called_with('loadbalancer/services',
body)
self.nsxlib.load_balancer.service.create(
body['display_name'], body['description'],
consts.FAKE_TAGS, enabled=body['enabled'],
attachment=body['attachment'])
create.assert_called_with('loadbalancer/services',
body)
def test_list_services(self):
with mock.patch.object(self.nsxlib.client, 'list') as list_call:

View File

@ -181,7 +181,7 @@ class ClientCertificateManager(object):
try:
self._storage_driver.delete_cert(self._identity)
except Exception:
except Exception as e:
LOG.error("Failed to clear certificate in storage: %s", e)
ok = False

View File

@ -282,7 +282,7 @@ class NSXRequestsHTTPProvider(AbstractHTTPProvider):
else:
for header_name in resp.headers:
if self.SET_COOKIE_FIELD.lower() == header_name.lower():
m = re.match('%s=.*?\;' % self.JSESSIONID,
m = re.match('%s=.*?\;' % self.JSESSIONID, # noqa
resp.headers[header_name])
if m:
session.default_headers[self.COOKIE_FIELD] = (