Move to f-strings

Used:
$ flynt -a -tc . vppcfg

Execution time:                            0.216s
Files checked:                             24
Files modified:                            13
Character count reduction:                 632 (0.36%)

Per expression type:
Old style (`%`) expressions attempted:     209/211 (99.1%)
No `.format(...)` calls attempted.
No concatenations attempted.
F-string expressions created:              205

Ran an integration test before and after. No diffs.
This commit is contained in:
Pim van Pelt
2022-04-22 10:58:41 +00:00
parent 13cdba1e1d
commit e13694a566
13 changed files with 205 additions and 205 deletions

View File

@ -25,7 +25,7 @@ class Dumper(VPPApi):
if fh is not sys.stdout:
fh.close()
self.logger.info("Wrote YAML config to %s" % (outfile))
self.logger.info(f"Wrote YAML config to {outfile}")
def cache_to_config(self):
config = {"loopbacks": {}, "bondethernets": {}, "interfaces": {}, "bridgedomains": {}, "vxlan_tunnels": {}, "taps": {} }
@ -51,7 +51,7 @@ class Dumper(VPPApi):
if iface.interface_dev_type=='Loopback':
if iface.sub_id > 0:
self.logger.warning("Refusing to export sub-interfaces of loopback devices (%s)" % iface.interface_name)
self.logger.warning(f"Refusing to export sub-interfaces of loopback devices ({iface.interface_name})")
continue
loop = {"description": ""}
loop['mtu'] = iface.mtu[0]
@ -136,7 +136,7 @@ class Dumper(VPPApi):
for idx, iface in self.cache['bridgedomains'].items():
# self.logger.info("%d: %s" % (idx, iface))
bridge_name = "bd%d" % idx
bridge_name = f"bd{int(idx)}"
mtu = 1500
bridge = {"description": ""}
settings = {}