Merge "pylint fixes"

This commit is contained in:
Zuul 2020-09-10 12:14:05 +00:00 committed by Gerrit Code Review
commit bbd3a2f2d5
7 changed files with 10 additions and 18 deletions

View File

@ -21,9 +21,6 @@ disable =
missing-class-docstring, missing-class-docstring,
missing-function-docstring, missing-function-docstring,
missing-module-docstring, missing-module-docstring,
no-else-break,
no-else-raise,
no-else-return,
no-member, no-member,
no-self-use, no-self-use,
protected-access, protected-access,

View File

@ -140,7 +140,7 @@ class RecheckWatch(threading.Thread):
if channel in self.channel_config.projects['all']: if channel in self.channel_config.projects['all']:
display = True display = True
break break
elif project in self.channel_config.projects: if project in self.channel_config.projects:
if channel in self.channel_config.projects[project]: if channel in self.channel_config.projects[project]:
display = True display = True
break break

View File

@ -121,8 +121,7 @@ def _status_count(results):
def _failure_count(hits): def _failure_count(hits):
if "FAILURE" in hits: if "FAILURE" in hits:
return hits["FAILURE"] return hits["FAILURE"]
else: return 0
return 0
def _failed_jobs(results): def _failed_jobs(results):

View File

@ -269,8 +269,7 @@ def _status_count(results):
def _failure_count(hits): def _failure_count(hits):
if "FAILURE" in hits: if "FAILURE" in hits:
return hits["FAILURE"] return hits["FAILURE"]
else: return 0
return 0
def _failed_jobs(results): def _failed_jobs(results):

View File

@ -145,7 +145,7 @@ class FailEvent(object):
return None return None
bug_map = {} bug_map = {}
for job in self.failed_jobs: for job in self.failed_jobs:
if len(job.bugs) is 0: if len(job.bugs) == 0:
bug_map[job.name] = None bug_map[job.name] = None
else: else:
bug_map[job.name] = ' '.join(self.bug_urls(job.bugs)) bug_map[job.name] = ' '.join(self.bug_urls(job.bugs))
@ -161,7 +161,7 @@ class FailEvent(object):
if self.get_all_bugs() is None: if self.get_all_bugs() is None:
return True return True
for job in self.failed_jobs: for job in self.failed_jobs:
if len(job.bugs) is 0: if len(job.bugs) == 0:
return False return False
return True return True
@ -181,7 +181,7 @@ class FailEvent(object):
bugs = set([]) bugs = set([])
for job in self.failed_jobs: for job in self.failed_jobs:
bugs |= set(job.bugs) bugs |= set(job.bugs)
if len(bugs) is 0: if len(bugs) == 0:
return None return None
return list(bugs) return list(bugs)
@ -239,9 +239,8 @@ class Stream(object):
msg = ("Console logs not ready for %s %s,%s,%s" % msg = ("Console logs not ready for %s %s,%s,%s" %
(name, change, patch, build_short_uuid)) (name, change, patch, build_short_uuid))
raise ConsoleNotReady(msg) raise ConsoleNotReady(msg)
else: self.log.debug("Console ready for %s %s,%s,%s" %
self.log.debug("Console ready for %s %s,%s,%s" % (name, change, patch, build_short_uuid))
(name, change, patch, build_short_uuid))
def _has_required_files(self, change, patch, name, build_short_uuid): def _has_required_files(self, change, patch, name, build_short_uuid):
query = qb.files_ready(change, patch, name, build_short_uuid) query = qb.files_ready(change, patch, name, build_short_uuid)

View File

@ -169,8 +169,7 @@ class FacetSet(dict):
epoch = datetime.datetime.fromtimestamp(0, pytz.UTC) epoch = datetime.datetime.fromtimestamp(0, pytz.UTC)
pos = int(((ts - epoch).total_seconds()) * 1000) pos = int(((ts - epoch).total_seconds()) * 1000)
return pos return pos
else: return data
return data
def detect_facets(self, results, facets, res=3600): def detect_facets(self, results, facets, res=3600):
if len(facets) > 0: if len(facets) > 0:

View File

@ -32,8 +32,7 @@ class Gerrit(object):
def getEvent(self): def getEvent(self):
if len(self.events) > 0: if len(self.events) > 0:
return self.events.pop() return self.events.pop()
else: raise GerritDone()
raise GerritDone()
def review(self, project, name, msg): def review(self, project, name, msg):
self.reviews.append({'project': project, 'name': name, 'msg': msg}) self.reviews.append({'project': project, 'name': name, 'msg': msg})