diff --git a/bin/swift-account-audit b/bin/swift-account-audit index c0d82c70..7e91ae31 100755 --- a/bin/swift-account-audit +++ b/bin/swift-account-audit @@ -266,7 +266,7 @@ class Auditor(object): responses[node_id][1].extend(results) if results: marker = results[-1]['name'] - headers = [resp[0] for resp in responses.values()] + headers = [r[0] for r in responses.values()] cont_counts = [int(header['x-account-container-count']) for header in headers] if len(set(cont_counts)) != 1: diff --git a/swift/common/middleware/x_profile/html_viewer.py b/swift/common/middleware/x_profile/html_viewer.py index 85426a93..90a5ab87 100644 --- a/swift/common/middleware/x_profile/html_viewer.py +++ b/swift/common/middleware/x_profile/html_viewer.py @@ -412,7 +412,7 @@ class HTMLViewer(object): nfls.append(func[2]) performance.append(metric[metric_selected]) y_pos = range(len(nfls)) - error = [random.random() for __ in y_pos] + error = [random.random() for _unused in y_pos] plt.clf() if plot_type == 'pie': plt.pie(x=performance, explode=None, labels=nfls, diff --git a/test/probe/test_container_merge_policy_index.py b/test/probe/test_container_merge_policy_index.py index cd60e6de..0b908523 100644 --- a/test/probe/test_container_merge_policy_index.py +++ b/test/probe/test_container_merge_policy_index.py @@ -392,11 +392,10 @@ class TestContainerMergePolicyIndex(ReplProbeTest): # at this point two primaries have old policy container_part, container_nodes = self.container_ring.get_nodes( self.account, self.container_name) - head_responses = [] - for node in container_nodes: - metadata = direct_client.direct_head_container( - node, container_part, self.account, self.container_name) - head_responses.append((node, metadata)) + head_responses = [ + (node, direct_client.direct_head_container( + node, container_part, self.account, self.container_name)) + for node in container_nodes] old_container_node_ids = [ node['id'] for node, metadata in head_responses if int(old_policy) == diff --git a/test/unit/proxy/controllers/test_obj.py b/test/unit/proxy/controllers/test_obj.py index bec610c5..dd4b2486 100755 --- a/test/unit/proxy/controllers/test_obj.py +++ b/test/unit/proxy/controllers/test_obj.py @@ -2209,8 +2209,8 @@ class TestECObjController(BaseObjectControllerMixin, unittest.TestCase): fragment_payloads.append(fragments) # join up the fragment payloads per node - ec_archive_bodies = [''.join(fragments) - for fragments in zip(*fragment_payloads)] + ec_archive_bodies = [''.join(frags) + for frags in zip(*fragment_payloads)] return ec_archive_bodies def _make_ec_object_stub(self, test_body=None, policy=None): diff --git a/tox.ini b/tox.ini index a30a3bd5..de7e2c0b 100644 --- a/tox.ini +++ b/tox.ini @@ -98,7 +98,6 @@ commands = bandit -c bandit.yaml -r swift bin -n 5 -p gate [flake8] # it's not a bug that we aren't using all of hacking, ignore: -# F812: list comprehension redefines ... # H101: Use TODO(NAME) # H202: assertRaises Exception too broad # H233: Python 3.x incompatible use of print operator @@ -109,7 +108,7 @@ commands = bandit -c bandit.yaml -r swift bin -n 5 -p gate # H404: multi line docstring should start without a leading new line # H405: multi line docstring summary not separated with an empty line # H501: Do not use self.__dict__ for string formatting -ignore = F812,H101,H202,H301,H306,H401,H403,H404,H405,H501 +ignore = H101,H202,H301,H306,H401,H403,H404,H405,H501 exclude = .venv,.tox,dist,*egg filename = *.py,bin/* show-source = True