diff mbox series

[4/8] rteval: rtevalConfig.py: Convert regular strings to f-strings

Message ID 20230203211527.71181-4-jkacur@redhat.com
State New
Headers show
Series [1/8] rteval: rteval/__init__.py: Convert regular strings to f-strings | expand

Commit Message

John Kacur Feb. 3, 2023, 9:15 p.m. UTC
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 mbox series

Patch

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):