Merge "Fix some flake8 violations"

This commit is contained in:
Jenkins
2016-02-11 03:24:06 +00:00
committed by Gerrit Code Review
5 changed files with 7 additions and 7 deletions

View File

@@ -497,7 +497,7 @@ class Resource(RequestIdMixin):
def __getattr__(self, k): def __getattr__(self, k):
if k not in self.__dict__: if k not in self.__dict__:
#NOTE(bcwaldon): disallow lazy-loading if already loaded once # NOTE(bcwaldon): disallow lazy-loading if already loaded once
if not self.is_loaded(): if not self.is_loaded():
self.get() self.get()
return self.__getattr__(k) return self.__getattr__(k)

View File

@@ -81,7 +81,7 @@ class FakeHTTPClient(client.HTTPClient):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.callstack = [] self.callstack = []
self.fixtures = kwargs.pop("fixtures", None) or {} self.fixtures = kwargs.pop("fixtures", None) or {}
if not args and not "auth_plugin" in kwargs: if not args and "auth_plugin" not in kwargs:
args = (None, ) args = (None, )
super(FakeHTTPClient, self).__init__(*args, **kwargs) super(FakeHTTPClient, self).__init__(*args, **kwargs)

View File

@@ -110,7 +110,7 @@ class _Win32Colorizer(object):
win32console.FOREGROUND_INTENSITY) win32console.FOREGROUND_INTENSITY)
self.stream = stream self.stream = stream
self.screenBuffer = win32console.GetStdHandle( self.screenBuffer = win32console.GetStdHandle(
win32console.STD_OUT_HANDLE) win32console.STD_OUT_HANDLE)
self._colors = { self._colors = {
'normal': red | green | blue, 'normal': red | green | blue,
'red': red | bold, 'red': red | bold,
@@ -266,7 +266,7 @@ class NovaTestResult(testtools.TestResult):
if not self.last_written or (self._now() - time).total_seconds() > 2.0: if not self.last_written or (self._now() - time).total_seconds() > 2.0:
diff = 3.0 diff = 3.0
while diff > 2.0: while diff > 2.0:
classes =list(self.results) classes = list(self.results)
oldest = min(classes, key=lambda x: self.last_time[x]) oldest = min(classes, key=lambda x: self.last_time[x])
diff = (self._now() - self.last_time[oldest]).total_seconds() diff = (self._now() - self.last_time[oldest]).total_seconds()
self.writeTestCase(oldest) self.writeTestCase(oldest)

View File

@@ -22,7 +22,7 @@ import ConfigParser
import os import os
import sys import sys
import install_venv_common as install_venv # flake8: noqa import install_venv_common as install_venv
def print_help(project, venv, root): def print_help(project, venv, root):
@@ -42,7 +42,7 @@ def print_help(project, venv, root):
$ %(root)s/tools/with_venv.sh <your command> $ %(root)s/tools/with_venv.sh <your command>
""" """
print help % dict(project=project, venv=venv, root=root) print (help % dict(project=project, venv=venv, root=root))
def main(argv): def main(argv):

View File

@@ -44,4 +44,4 @@ passenv = OS_*
[flake8] [flake8]
show-source = True show-source = True
ignore = F811,F821,H306,H404,H405,E122,E123,E128,E251 ignore = F811,F821,H306,H404,H405,E122,E123,E128,E251
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build