diff --git a/.flake8 b/.flake8 index 25e0ae17..e9b4d23d 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,4 @@ [flake8] exclude = abichecker max-line-length = 100 -ignore = E501,F401,E128,E251,E201,E202,E302,E305,F841,E261,E712,E126,E711,E125,E123,E101,E124,E127,E701,E714,W504,E129,E741 +ignore = E501,F401,E128,E251,E201,E202,E302,E305,F841,E261,E712,E126,E711,E125,E123,E101,E124,E127,E714,W504,E129,E741 diff --git a/check_source.py b/check_source.py index 18ee1bfb..3a78520f 100755 --- a/check_source.py +++ b/check_source.py @@ -339,7 +339,8 @@ class CheckSource(ReviewBot.ReviewBot): self.logger.info( 'Checking required maintainer from the source project (%s)' % self.required_maintainer ) - if not self.required_maintainer: return True + if not self.required_maintainer: + return True meta = ET.fromstringlist(show_project_meta(self.apiurl, source_project)) maintainers = meta.xpath('//person[@role="maintainer"]/@userid') diff --git a/osclib/cache.py b/osclib/cache.py index 6e757ad6..984bf1c6 100644 --- a/osclib/cache.py +++ b/osclib/cache.py @@ -112,7 +112,8 @@ class Cache(object): Cache.patterns = [] if str2bool(os.environ.get('OSRT_DISABLE_CACHE', '')): - if conf.config['debug']: print('CACHE_DISABLE via $OSRT_DISABLE_CACHE', file=sys.stderr) + if conf.config['debug']: + print('CACHE_DISABLE via $OSRT_DISABLE_CACHE', file=sys.stderr) return for pattern in Cache.PATTERNS: @@ -170,11 +171,13 @@ class Cache(object): Cache.delete_project(apiurl, project) if os.path.exists(path) and time() - os.path.getmtime(path) <= ttl: - if conf.config['debug']: print('CACHE_GET', url, file=sys.stderr) + if conf.config['debug']: + print('CACHE_GET', url, file=sys.stderr) return urlopen('file://' + path) else: reason = '(' + ('expired' if os.path.exists(path) else 'does not exist') + ')' - if conf.config['debug']: print('CACHE_MISS', url, reason, file=sys.stderr) + if conf.config['debug']: + print('CACHE_MISS', url, reason, file=sys.stderr) return None @@ -195,7 +198,8 @@ class Cache(object): text = data.read() data = BytesIO(text) - if conf.config['debug']: print('CACHE_PUT', url, project, file=sys.stderr) + if conf.config['debug']: + print('CACHE_PUT', url, project, file=sys.stderr) f = open(path, 'wb') f.write(text) f.close() @@ -219,7 +223,8 @@ class Cache(object): Cache.delete_project(apiurl, project) if os.path.exists(path): - if conf.config['debug']: print('CACHE_DELETE', url, file=sys.stderr) + if conf.config['debug']: + print('CACHE_DELETE', url, file=sys.stderr) os.remove(path) # Also delete version without query. This does not handle other @@ -234,7 +239,8 @@ class Cache(object): path = Cache.path(apiurl, project) if os.path.exists(path): - if conf.config['debug']: print('CACHE_DELETE_PROJECT', apiurl, project, file=sys.stderr) + if conf.config['debug']: + print('CACHE_DELETE_PROJECT', apiurl, project, file=sys.stderr) rmtree_nfs_safe(path) @staticmethod diff --git a/osclib/list_command.py b/osclib/list_command.py index 3cd34d47..632c3832 100644 --- a/osclib/list_command.py +++ b/osclib/list_command.py @@ -27,7 +27,8 @@ class ListCommand: SupersedeCommand(self.api).perform() requests = self.api.get_open_requests() - if not len(requests): return + if not len(requests): + return splitter = RequestSplitter(self.api, requests, in_ring=True) splitter.group_by('./action/target/@devel_project') diff --git a/osclib/obslock.py b/osclib/obslock.py index 92931c8a..ea26e94d 100644 --- a/osclib/obslock.py +++ b/osclib/obslock.py @@ -74,7 +74,8 @@ class OBSLock(object): http_POST(url, data=data) def acquire(self): - if not self.needed: return self + if not self.needed: + return self # If the project doesn't have locks configured, raise a # Warning (but continue the operation) @@ -114,7 +115,8 @@ class OBSLock(object): return self def release(self, force=False): - if not force and not self.needed: return + if not force and not self.needed: + return # If the project do not have locks configured, simply ignore # the operation. diff --git a/pkglistgen/group.py b/pkglistgen/group.py index 734bb142..b059beca 100644 --- a/pkglistgen/group.py +++ b/pkglistgen/group.py @@ -52,7 +52,8 @@ class Group(object): for a in archs: # we use groups.yml for powerpc through a branch, # so ignore inapplicable architectures - if a not in self.packages: continue + if a not in self.packages: + continue self.packages[a].append([package, self.name]) def parse_yml(self, packages): @@ -222,7 +223,8 @@ class Group(object): jobs += sel.jobs(solv.Job.SOLVER_LOCK) for n in list(solved[arch]) + list(suggested): - if n in locked: continue + if n in locked: + continue sel = pool.select(str(n), solv.Selection.SELECTION_NAME) jobs += sel.jobs(solv.Job.SOLVER_INSTALL) diff --git a/pkglistgen/update_repo_handler.py b/pkglistgen/update_repo_handler.py index 610c6054..a4770b7e 100644 --- a/pkglistgen/update_repo_handler.py +++ b/pkglistgen/update_repo_handler.py @@ -162,7 +162,8 @@ def print_repo_delta(pool, repo2, packages_file): present.setdefault(key, {}) present[key][s.evr] = s.repo for s in repo2.solvables: - if s.arch == 'src': continue + if s.arch == 'src': + continue key = '{}/{}'.format(s.name, s.arch) if present.get(key, {}).get(s.evr): continue diff --git a/tests/OBSLocal.py b/tests/OBSLocal.py index d07f35a9..91cea45e 100644 --- a/tests/OBSLocal.py +++ b/tests/OBSLocal.py @@ -351,9 +351,11 @@ class StagingWorkflow(ABC): def create_attribute_type(self, namespace, name, values=None): """Creates a new attribute type in the OBS instance.""" - if namespace not in self.attr_types: self.attr_types[namespace] = [] + if namespace not in self.attr_types: + self.attr_types[namespace] = [] - if name not in self.attr_types[namespace]: self.attr_types[namespace].append(name) + if name not in self.attr_types[namespace]: + self.attr_types[namespace].append(name) meta = """ @@ -446,7 +448,8 @@ class StagingWorkflow(ABC): :param name: name of the user :type name: str """ - if name in self.users: return + if name in self.users: + return meta = """ {} @@ -478,7 +481,8 @@ class StagingWorkflow(ABC): After the execution, the target project is indexed in the projects dictionary twice, by its name and as 'target'. """ - if self.projects.get('target'): return + if self.projects.get('target'): + return self.create_target_project() self.create_staging_users() @@ -1056,7 +1060,8 @@ class Request(object): self.revoke() def revoke(self): - if self.revoked: return + if self.revoked: + return self.change_state('revoked') self.revoked = True