further f string updates
This commit is contained in:
parent
c9326b6a97
commit
79cde8cd59
11 changed files with 21 additions and 55 deletions
|
@ -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"
|
||||
|
||||
|
|
|
@ -24,25 +24,6 @@ def parse_options(name):
|
|||
|
||||
options = parser.parse_args()
|
||||
|
||||
# usagestr = "usage: %prog [-h] [options] [args]"
|
||||
# parser = optparse.OptionParser(usage=usagestr)
|
||||
#
|
||||
# parser.add_option("-n", "--nodes", dest="nodes", type=int, default=DEFAULT_NODES,
|
||||
# help="number of nodes to create in this example")
|
||||
#
|
||||
# parser.add_option("-t", "--time", dest="time", type=int, default=DEFAULT_TIME,
|
||||
# help="example iperf run time in seconds")
|
||||
|
||||
# def usage(msg=None, err=0):
|
||||
# print
|
||||
# if msg:
|
||||
# print "%s\n" % msg
|
||||
# parser.print_help()
|
||||
# sys.exit(err)
|
||||
|
||||
# parse command line options
|
||||
# options, args = parser.parse_args()
|
||||
|
||||
if options.nodes < 2:
|
||||
parser.error("invalid min number of nodes: %s" % options.nodes)
|
||||
if options.time < 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue