Merge "Turn on F812 check"

This commit is contained in:
Jenkins 2016-09-19 16:35:17 +00:00 committed by Gerrit Code Review
commit 93b02c931f
5 changed files with 9 additions and 11 deletions

View File

@ -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:

View File

@ -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,

View File

@ -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) ==

View File

@ -2218,8 +2218,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,

View File

@ -98,7 +98,6 @@ commands = bandit -c bandit.yaml -r swift -n 5
[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 -n 5
# 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