Skip to content

Commit

Permalink
pylint: fix new errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jrusz authored and gicmo committed Jun 29, 2022
1 parent 7a70cfd commit 12773db
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions plugins/builder/osbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def attach_logs(self, compose_id: str, ireqs: List[ImageRequest]):

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)

Expand All @@ -539,7 +539,7 @@ def attach_manifests(self, compose_id: str, ireqs: List[ImageRequest]):

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)

Expand Down
9 changes: 4 additions & 5 deletions plugins/cli/osbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_koji.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def creator():

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]
Expand Down

0 comments on commit 12773db

Please sign in to comment.