aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-01-10 13:20:51 +0000
committerSam James <sam@gentoo.org>2023-01-10 15:12:38 +0000
commit3a5b0362f634e9514ed3a48efe77089f6457e048 (patch)
tree1c9cdf0ead24ae635cefb63c7f91c6cdd6d78c83 /bin/glsa-check
parentdepgraph: Print dependency resolution time (diff)
downloadportage-3a5b0362f634e9514ed3a48efe77089f6457e048.tar.gz
portage-3a5b0362f634e9514ed3a48efe77089f6457e048.tar.bz2
portage-3a5b0362f634e9514ed3a48efe77089f6457e048.zip
*/*: convert to f-strings (run flynt)
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'bin/glsa-check')
-rwxr-xr-xbin/glsa-check16
1 files changed, 8 insertions, 8 deletions
diff --git a/bin/glsa-check b/bin/glsa-check
index 753c13891..436038702 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -211,7 +211,7 @@ if "affected" in params:
except (GlsaTypeException, GlsaFormatException) as e:
if verbose:
sys.stderr.write(
- "invalid GLSA: {} (error message was: {})\n".format(x, e)
+ f"invalid GLSA: {x} (error message was: {e})\n"
)
continue
if myglsa.isVulnerable():
@@ -250,7 +250,7 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr, encoding="utf-8"):
myglsa = Glsa(myid, portage.settings, vardb, portdb)
except (GlsaTypeException, GlsaFormatException) as e:
if verbose:
- fd2.write("invalid GLSA: {} (error message was: {})\n".format(myid, e))
+ fd2.write(f"invalid GLSA: {myid} (error message was: {e})\n")
continue
if myglsa.isInjected():
status = "[A]"
@@ -320,7 +320,7 @@ if mode in ["dump", "fix", "inject", "pretend"]:
except (GlsaTypeException, GlsaFormatException) as e:
if verbose:
sys.stderr.write(
- "invalid GLSA: {} (error message was: {})\n".format(myid, e)
+ f"invalid GLSA: {myid} (error message was: {e})\n"
)
continue
if mode == "dump":
@@ -414,7 +414,7 @@ if mode == "test":
except (GlsaTypeException, GlsaFormatException) as e:
if verbose:
sys.stderr.write(
- "invalid GLSA: {} (error message was: {})\n".format(myid, e)
+ f"invalid GLSA: {myid} (error message was: {e})\n"
)
continue
if myglsa.isVulnerable():
@@ -450,13 +450,13 @@ if mode == "mail":
else:
myfrom = "glsa-check"
- mysubject = "[glsa-check] Summary for %s" % socket.getfqdn()
+ mysubject = f"[glsa-check] Summary for {socket.getfqdn()}"
# need a file object for summarylist()
myfd = BytesIO()
- line = "GLSA Summary report for host %s\n" % socket.getfqdn()
+ line = f"GLSA Summary report for host {socket.getfqdn()}\n"
myfd.write(line.encode("utf-8"))
- line = "(Command was: %s)\n\n" % " ".join(sys.argv)
+ line = f"(Command was: {' '.join(sys.argv)})\n\n"
myfd.write(line.encode("utf-8"))
summarylist(glsalist, fd1=myfd, fd2=myfd)
summary = myfd.getvalue().decode("utf-8")
@@ -469,7 +469,7 @@ if mode == "mail":
except (GlsaTypeException, GlsaFormatException) as e:
if verbose:
sys.stderr.write(
- "invalid GLSA: {} (error message was: {})\n".format(myid, e)
+ f"invalid GLSA: {myid} (error message was: {e})\n"
)
continue
myfd = BytesIO()