further f string updates

This commit is contained in:
Blake Harnden 2019-10-17 19:25:52 -07:00
parent c9326b6a97
commit 79cde8cd59
11 changed files with 21 additions and 55 deletions

View file

@ -37,7 +37,7 @@ class MyService(CoreService):
dependencies = ()
dirs = ()
configs = ("myservice1.sh", "myservice2.sh")
startup = ("sh %s" % configs[0], "sh %s" % configs[1])
startup = tuple(f"sh {x}" for x in configs)
validate = ()
validation_mode = ServiceMode.NON_BLOCKING
validation_timer = 5
@ -81,7 +81,7 @@ class MyService(CoreService):
if filename == cls.configs[0]:
cfg += "# auto-generated by MyService (sample.py)\n"
for ifc in node.netifs():
cfg += 'echo "Node %s has interface %s"\n' % (node.name, ifc.name)
cfg += f'echo "Node {node.name} has interface {ifc.name}"\n'
elif filename == cls.configs[1]:
cfg += "echo hello"