From 64a003315073ae3b835dde9b9cd9564e104d64dc Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: May 13 2020 07:56:36 +0000 Subject: fix additional flake8 problems --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index a56e958..6c2bcc8 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -2612,7 +2612,7 @@ def anon_handle_list_untagged(goptions, session, args): if refs.get('rpms'): r.append("rpms: %s" % refs['rpms']) if refs.get('component_of'): - r.append("images/archives: %" % refs['component_of']) + r.append("images/archives: %s" % refs['component_of']) if refs.get('archives'): r.append("archives buildroots: %s" % refs['archives']) build['refs'] = ', '.join(r) diff --git a/koji/util.py b/koji/util.py index 3cf49c3..f2f4c34 100644 --- a/koji/util.py +++ b/koji/util.py @@ -123,18 +123,18 @@ def duration(start): return '%s:%02i' % (mins, secs) -def printList(l): +def printList(lst): """Print the contents of the list comma-separated""" - if len(l) == 0: + if len(lst) == 0: return '' - elif len(l) == 1: - return l[0] - elif len(l) == 2: - return ' and '.join(l) + elif len(lst) == 1: + return lst[0] + elif len(lst) == 2: + return ' and '.join(lst) else: - ret = ', '.join(l[:-1]) + ret = ', '.join(lst[:-1]) ret += ', and ' - ret += l[-1] + ret += lst[-1] return ret @@ -838,7 +838,7 @@ def parse_maven_chain(confs, scratch=False): return builds -def to_list(l): +def to_list(lst): """ Helper function for py2/py3 compatibility used e.g. in list(dict.keys()) @@ -847,7 +847,7 @@ def to_list(l): used, so it is always an iterator. """ - if isinstance(l, list): - return l + if isinstance(lst, list): + return lst else: - return list(l) + return list(lst) diff --git a/plugins/hub/runroot_hub.py b/plugins/hub/runroot_hub.py index 726fc5f..cda0f8f 100644 --- a/plugins/hub/runroot_hub.py +++ b/plugins/hub/runroot_hub.py @@ -13,7 +13,7 @@ from koji.context import context from koji.plugin import export # XXX - have to import kojihub for make_task sys.path.insert(0, '/usr/share/koji-hub/') -import kojihub # noqa: F402 +import kojihub # noqa: E402 __all__ = ('runroot',) diff --git a/plugins/hub/save_failed_tree.py b/plugins/hub/save_failed_tree.py index 8a1d644..29e2579 100644 --- a/plugins/hub/save_failed_tree.py +++ b/plugins/hub/save_failed_tree.py @@ -6,7 +6,7 @@ import koji from koji.context import context from koji.plugin import export sys.path.insert(0, '/usr/share/koji-hub/') -import kojihub # noqa: F402 +import kojihub # noqa: E402 __all__ = ('saveFailedTree',) diff --git a/plugins/hub/sidetag_hub.py b/plugins/hub/sidetag_hub.py index afa346e..beb40ba 100644 --- a/plugins/hub/sidetag_hub.py +++ b/plugins/hub/sidetag_hub.py @@ -8,7 +8,7 @@ import koji.policy from koji.context import context from koji.plugin import callback, export sys.path.insert(0, "/usr/share/koji-hub/") -from kojihub import ( # noqa: F402 +from kojihub import ( # noqa: E402 QueryProcessor, _create_build_target, _create_tag, diff --git a/vm/kojikamid.py b/vm/kojikamid.py index ad41fed..7bd9dec 100755 --- a/vm/kojikamid.py +++ b/vm/kojikamid.py @@ -336,8 +336,8 @@ class WindowsBuild(object): checksum = hashlib.md5() else: raise BuildError('Unknown checksum type %s for %s' % ( # noqa: F821 - checksum_type, - os.path.basename(fileinfo['localpath']))) + checksum_type, + os.path.basename(fileinfo['localpath']))) with open(destpath, 'w') as destfile: offset = 0 while True: