pylint: fix new errors
This commit is contained in:
parent
7a70cfd42e
commit
12773dbe25
4 changed files with 8 additions and 9 deletions
|
|
@ -524,7 +524,7 @@ class OSBuildImage(BaseTaskHandler):
|
||||||
|
|
||||||
ilogs = zip(logs.image_logs, ireqs)
|
ilogs = zip(logs.image_logs, ireqs)
|
||||||
for log, ireq in ilogs:
|
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.logger.debug("Uploading logs: %s", name)
|
||||||
self.upload_json(log, name)
|
self.upload_json(log, name)
|
||||||
|
|
||||||
|
|
@ -539,7 +539,7 @@ class OSBuildImage(BaseTaskHandler):
|
||||||
|
|
||||||
imanifests = zip(manifests, ireqs)
|
imanifests = zip(manifests, ireqs)
|
||||||
for manifest, ireq in imanifests:
|
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.logger.debug("Uploading manifest: %s", name)
|
||||||
self.upload_json(manifest, name)
|
self.upload_json(manifest, name)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,12 +93,11 @@ def check_target(session, name):
|
||||||
|
|
||||||
target = session.getBuildTarget(name)
|
target = session.getBuildTarget(name)
|
||||||
if not target:
|
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'])
|
tag = session.getTag(target['dest_tag'])
|
||||||
if not tag:
|
if not tag:
|
||||||
raise koji.GenericError("Unknown destination tag: %s" %
|
raise koji.GenericError(f"Unknown destination tag: {target['dest_tag_name']}")
|
||||||
target['dest_tag_name'])
|
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-branches
|
# 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)
|
task_id = session.osbuildImage(name, version, distro, image_types, target, arch, opts=opts)
|
||||||
|
|
||||||
if not options.quiet:
|
if not options.quiet:
|
||||||
print("Created task: %s" % task_id)
|
print(f"Created task: {task_id}")
|
||||||
print("Task info: %s/taskinfo?taskID=%s" % (options.weburl, task_id))
|
print(f"Task info: {options.weburl}/taskinfo?taskID={task_id}")
|
||||||
|
|
||||||
# pylint: disable=protected-access
|
# pylint: disable=protected-access
|
||||||
if (args.wait is None and kl._running_in_bg()) or args.wait is False:
|
if (args.wait is None and kl._running_in_bg()) or args.wait is False:
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ def koji_command(*args, _input=None, _globals=None, **kwargs):
|
||||||
|
|
||||||
def parse_os_release():
|
def parse_os_release():
|
||||||
info = {}
|
info = {}
|
||||||
with open("/etc/os-release") as f:
|
with open("/etc/os-release", encoding="utf-8") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if not line:
|
if not line:
|
||||||
|
|
|
||||||
|
|
@ -478,7 +478,7 @@ class TestBuilderPlugin(PluginTest): # pylint: disable=too-many-public-methods
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tmp:
|
with tempfile.TemporaryDirectory() as tmp:
|
||||||
cfgfile = os.path.abspath(os.path.join(tmp, "ko.cfg"))
|
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)
|
config.write(f)
|
||||||
|
|
||||||
self.plugin.DEFAULT_CONFIG_FILES = [cfgfile]
|
self.plugin.DEFAULT_CONFIG_FILES = [cfgfile]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue