Fix and enable flake8 F823

F823 local variable 'blah' (defined in enclosing scope on line xx)
referenced before assignment

Change-Id: I721e1339ef023558032980bbf59e8dc44b391d52
This commit is contained in:
Joe Gordon 2013-05-28 06:59:13 +03:00
parent d9c145c7b8
commit d534b290a1
2 changed files with 3 additions and 3 deletions

View File

@ -31,8 +31,8 @@ class InstanceTypeTestCase(test.TestCase):
def _generate_name(self):
"""return a name not in the DB."""
nonexistent_flavor = str(int(time.time()))
flavors = flavors.get_all_types()
while nonexistent_flavor in flavors:
all_flavors = flavors.get_all_types()
while nonexistent_flavor in all_flavors:
nonexistent_flavor += "z"
else:
return nonexistent_flavor

View File

@ -40,7 +40,7 @@ commands =
commands = {posargs}
[flake8]
ignore = E12,E711,E712,H302,H303,H403,H404,F403,F811,F823,F841
ignore = E12,E711,E712,H302,H303,H403,H404,F403,F811,F841
builtins = _
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,plugins,tools