@@ -70,10 +70,10 @@ class SWUGenerator:
new = image
break
if not new:
- logging.debug("New artifact %s" % entry["filename"])
+ logging.debug("New artifact %s", entry["filename"])
new = Artifact(entry["filename"])
if not new.findfile(self.artifactory):
- logging.critical("Artifact %s not found" % entry["filename"])
+ logging.critical("Artifact %s not found", entry["filename"])
exit(22)
new.newfilename = entry["filename"]
@@ -83,7 +83,7 @@ class SWUGenerator:
if cmp == True:
cmp = "zlib"
if cmp != "zlib" and cmp != "zstd":
- logging.critical("Wrong compression algorithm: %s" % cmp)
+ logging.critical("Wrong compression algorithm: %s", cmp)
exit(1)
new_path = os.path.join(self.temp.name, new.newfilename) + "." + cmp
@@ -116,7 +116,7 @@ class SWUGenerator:
subprocess.run(" ".join(cmd), shell=True, check=True, text=True)
except:
logging.critical(
- "Cannot compress %s with %s" % (entry["filename"], cmd)
+ "Cannot compress %s with %s", entry["filename"], cmd
)
exit(1)
@@ -126,8 +126,7 @@ class SWUGenerator:
if "encrypted" in entry and not self.noencrypt:
if not self.aeskey:
logging.critical(
- "%s must be encrypted, but no encryption key is given"
- % entry["filename"]
+ "%s must be encrypted, but no encryption key is given", entry["filename"]
)
if self.noivt:
iv = self.aesiv
@@ -144,7 +143,7 @@ class SWUGenerator:
self.artifacts.append(new)
else:
- logging.debug("Artifact %s already stored" % entry["filename"])
+ logging.debug("Artifact %s already stored", entry["filename"])
entry["filename"] = new.newfilename
entry["sha256"] = new.getsha256()
@@ -159,7 +158,7 @@ class SWUGenerator:
for t in val:
self.find_files_in_swdesc(t)
else:
- logging.debug("%s = %s" % (n, val))
+ logging.debug("%s = %s", n, val)
if n == "filename":
self.filelist.append(first)
@@ -21,7 +21,7 @@ def extract_keys(keyfile):
with open(keyfile, "r") as f:
lines = f.readlines()
except IOError:
- logging.fatal("Failed to open file with keys %s" % (keyfile))
+ logging.fatal("Failed to open file with keys %s", keyfile)
exit(1)
key, iv = None, None
@@ -150,14 +150,14 @@ def main() -> None:
# Read configuration file if any
vars = {}
if args.config and args.config != "":
- logging.info("Reading configuration file %s" % args.config)
+ logging.info("Reading configuration file %s", args.config)
with codecs.open(args.config, "r", "utf-8") as f:
config = libconf.load(f)
for key, keydict in config.items():
if key == "variables":
for varname, varvalue in keydict.items():
- logging.debug("VAR = %s VAL = %s" % (varname, varvalue))
+ logging.debug("VAR = %s VAL = %s", varname, varvalue)
vars[varname] = varvalue
f.close()
@@ -29,7 +29,7 @@ class SWUSign:
subprocess.run(" ".join(self.signcmd), shell=True, check=True, text=True)
except:
logging.critical(
- "SWU cannot be signed, signing command was %s" % self.signcmd
+ "SWU cannot be signed, signing command was %s", self.signcmd
)
exit(1)