Fix F812 PEP8 error

One file was redefining a variable, thus exposing this PEP8 error:

    F812 list comprehension redefines 'n' from line 1868

This fixes it and enables the check in tox.ini.

Change-Id: Ifa9a2365160db1b8ec80b274f3458cea6bd1f653
This commit is contained in:
David Shrewsbury 2014-10-13 10:31:16 -04:00
parent cfcc3ec733
commit 46deca788b
2 changed files with 6 additions and 6 deletions
ironic/tests/conductor
tox.ini

@ -1899,14 +1899,14 @@ class ManagerSyncPowerStatesTestCase(_CommonMixIn, tests_db_base.DbTestCase):
get_nodeinfo_mock.assert_called_once_with(
columns=self.columns, filters=self.filters)
mapped_calls = [mock.call(n.uuid, n.driver) for n in nodes]
mapped_calls = [mock.call(x.uuid, x.driver) for x in nodes]
self.assertEqual(mapped_calls, mapped_mock.call_args_list)
get_node_calls = [mock.call(self.context, n.id)
for n in nodes[:1] + nodes[2:]]
get_node_calls = [mock.call(self.context, x.id)
for x in nodes[:1] + nodes[2:]]
self.assertEqual(get_node_calls,
get_node_mock.call_args_list)
acquire_calls = [mock.call(self.context, n.id)
for n in nodes[:1] + nodes[6:]]
acquire_calls = [mock.call(self.context, x.id)
for x in nodes[:1] + nodes[6:]]
self.assertEqual(acquire_calls, acquire_mock.call_args_list)
sync_calls = [mock.call(tasks[0]), mock.call(tasks[5])]
self.assertEqual(sync_calls, sync_mock.call_args_list)

@ -47,7 +47,7 @@ commands = {posargs}
[flake8]
# E711: ignored because it is normal to use "column == None" in sqlalchemy
# TODO(yuriyz): Analyze or fix the warnings blacklisted below
ignore = E12,E111,E113,E131,E265,E711,F812
ignore = E12,E111,E113,E131,E265,E711
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,*ironic/nova*
[hacking]