pylint: fix new errors

This commit is contained in:
Jakub Rusz 2022-06-21 09:55:49 +02:00 committed by Christian Kellner
parent 7a70cfd42e
commit 12773dbe25
4 changed files with 8 additions and 9 deletions

View file

@ -524,7 +524,7 @@ class OSBuildImage(BaseTaskHandler):
ilogs = zip(logs.image_logs, ireqs)
for log, ireq in ilogs:
name = "%s-%s.log" % (ireq.architecture, ireq.image_type)
name = f"{ireq.architecture}-{ireq.image_type}.log"
self.logger.debug("Uploading logs: %s", name)
self.upload_json(log, name)
@ -539,7 +539,7 @@ class OSBuildImage(BaseTaskHandler):
imanifests = zip(manifests, ireqs)
for manifest, ireq in imanifests:
name = "%s-%s.manifest" % (ireq.architecture, ireq.image_type)
name = f"{ireq.architecture}-{ireq.image_type}.manifest"
self.logger.debug("Uploading manifest: %s", name)
self.upload_json(manifest, name)

View file

@ -93,12 +93,11 @@ def check_target(session, name):
target = session.getBuildTarget(name)
if not target:
raise koji.GenericError("Unknown build target: %s" % name)
raise koji.GenericError(f"Unknown build target: {name}")
tag = session.getTag(target['dest_tag'])
if not tag:
raise koji.GenericError("Unknown destination tag: %s" %
target['dest_tag_name'])
raise koji.GenericError(f"Unknown destination tag: {target['dest_tag_name']}")
# pylint: disable=too-many-branches
@ -161,8 +160,8 @@ def handle_osbuild_image(options, session, argv):
task_id = session.osbuildImage(name, version, distro, image_types, target, arch, opts=opts)
if not options.quiet:
print("Created task: %s" % task_id)
print("Task info: %s/taskinfo?taskID=%s" % (options.weburl, task_id))
print(f"Created task: {task_id}")
print(f"Task info: {options.weburl}/taskinfo?taskID={task_id}")
# pylint: disable=protected-access
if (args.wait is None and kl._running_in_bg()) or args.wait is False:

View file

@ -39,7 +39,7 @@ def koji_command(*args, _input=None, _globals=None, **kwargs):
def parse_os_release():
info = {}
with open("/etc/os-release") as f:
with open("/etc/os-release", encoding="utf-8") as f:
for line in f:
line = line.strip()
if not line:

View file

@ -478,7 +478,7 @@ class TestBuilderPlugin(PluginTest): # pylint: disable=too-many-public-methods
with tempfile.TemporaryDirectory() as tmp:
cfgfile = os.path.abspath(os.path.join(tmp, "ko.cfg"))
with open(cfgfile, 'w') as f:
with open(cfgfile, 'w', encoding="utf-8") as f:
config.write(f)
self.plugin.DEFAULT_CONFIG_FILES = [cfgfile]