From 1448c7ff622b97f821a00d0ce2c9c667136f6ccd Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Sat, 21 Dec 2019 03:11:27 -0600 Subject: [PATCH] Raise hacking version to 2.0.0 We've kept hacking capped for a long time now. This raises the hacking package version to the latest release and fixes the issues that it found. Change-Id: Ib13a3fe3f1a103b5e24a7c5bb7838ffdae2bf198 Signed-off-by: Sean McGinnis --- lower-constraints.txt | 2 +- os_brick/initiator/connectors/disco.py | 26 +++++++++++++------------- os_brick/local_dev/lvm.py | 5 ++++- test-requirements.txt | 2 +- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index 711ed4953..2e2183cc2 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -19,7 +19,7 @@ fixtures==3.0.0 flake8==2.5.5 future==0.16.0 greenlet==0.4.10 -hacking==0.12.0 +hacking==2.0.0 idna==2.6 imagesize==0.7.1 iso8601==0.1.11 diff --git a/os_brick/initiator/connectors/disco.py b/os_brick/initiator/connectors/disco.py index 8374f81fd..3e22ef999 100644 --- a/os_brick/initiator/connectors/disco.py +++ b/os_brick/initiator/connectors/disco.py @@ -157,19 +157,19 @@ class DISCOConnector(base.BaseLinuxConnector): client_port, socket.AF_UNSPEC, socket.SOCK_STREAM): - aff, socktype, proto, canonname, saa = res - try: - sock = socket.socket(aff, socktype, proto) - except socket.error: - sock = None - continue - try: - sock.connect(saa) - except socket.error: - sock.close() - sock = None - continue - break + aff, socktype, proto, canonname, saa = res + try: + sock = socket.socket(aff, socktype, proto) + except socket.error: + sock = None + continue + try: + sock.connect(saa) + except socket.error: + sock.close() + sock = None + continue + break if sock is None: LOG.error("Cannot connect TCP socket") diff --git a/os_brick/local_dev/lvm.py b/os_brick/local_dev/lvm.py index 320436c49..61bf7a75a 100644 --- a/os_brick/local_dev/lvm.py +++ b/os_brick/local_dev/lvm.py @@ -184,7 +184,10 @@ class LVM(executor.Executor): consumed_space = pool_size / 100 * data_percent free_space = pool_size - consumed_space free_space = round(free_space, 2) - except putils.ProcessExecutionError as err: + # Need noqa due to a false error about the 'err' variable being unused + # even though it is used in the logging. Possibly related to + # https://github.com/PyCQA/pyflakes/issues/378. + except putils.ProcessExecutionError as err: # noqa LOG.exception('Error querying thin pool about data_percent') LOG.error('Cmd :%s', err.cmd) LOG.error('StdOut :%s', err.stdout) diff --git a/test-requirements.txt b/test-requirements.txt index b0e98f6b9..2adf0c629 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=1.1.0,<1.2.0 # Apache-2.0 +hacking>=2.0.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 ddt>=1.0.1 # MIT reno>=2.5.0 # Apache-2.0