rteval/rteval-rtevalConfig.py-Convert-regular-strings-to-f-.patch

65 lines
2.3 KiB
Diff
Raw Normal View History

From 0945147e2c459dfff400fe8bfdebd11e6464eab4 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Wed, 9 Nov 2022 14:14:50 -0500
Subject: rteval: rtevalConfig.py: Convert regular strings to f-strings
Convert regular strings to f-strings in rtevalConfig.py
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/rtevalConfig.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/rteval/rtevalConfig.py b/rteval/rtevalConfig.py
index decd36ed18ab..de88924642ca 100644
--- a/rteval/rtevalConfig.py
+++ b/rteval/rtevalConfig.py
@@ -196,7 +196,7 @@ class rtevalConfig:
# get our system topology info
self.__systopology = SysTopology()
- print(("got system topology: %s" % self.__systopology))
+ print(f"got system topology: {self.__systopology}")
# Import the default config first
for sect, vals in list(default_config.items()):
@@ -225,7 +225,7 @@ class rtevalConfig:
"Simple method for dumping config when object is used as a string"
ret = ""
for sect in list(self.__config_data.keys()):
- ret += "[%s]\n%s\n" % (sect, str(self.__config_data[sect]))
+ ret += f"[{sect}]\n{str(self.__config_data[sect])}\n"
return ret
@@ -240,7 +240,7 @@ class rtevalConfig:
for f in ('rteval.conf', '/etc/rteval.conf'):
p = os.path.abspath(f)
if os.path.exists(p):
- self.__info("found config file %s" % p)
+ self.__info(f"found config file {p}")
return p
raise RuntimeError("Unable to find configfile")
@@ -258,7 +258,7 @@ class rtevalConfig:
# Don't try to reread this file if it's already been parsed
return
- self.__info("reading config file %s" % cfgfile)
+ self.__info(f"reading config file {cfgfile}")
ini = configparser.ConfigParser()
ini.optionxform = str
ini.read(cfgfile)
@@ -321,7 +321,7 @@ class rtevalConfig:
# Return a new object with config settings of a given section
return self.__config_data[section]
except KeyError:
- raise KeyError("The section '%s' does not exist in the config file" % section)
+ raise KeyError(f"The section '{section}' does not exist in the config file")
def unit_test(rootdir):
--
2.40.1