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 78e3e2a34..81f1fcd69 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