more updates to using f string
This commit is contained in:
parent
79cde8cd59
commit
7d2a615716
23 changed files with 248 additions and 251 deletions
|
@ -41,14 +41,12 @@ def example(options):
|
|||
first_node = session.get_node(2)
|
||||
last_node = session.get_node(options.nodes + 1)
|
||||
|
||||
print("starting iperf server on node: %s" % first_node.name)
|
||||
logging.info("starting iperf server on node: %s", first_node.name)
|
||||
first_node.node_net_cmd("iperf -s -D")
|
||||
first_node_address = prefixes.ip4_address(first_node)
|
||||
print("node %s connecting to %s" % (last_node.name, first_node_address))
|
||||
output = last_node.node_net_cmd(
|
||||
"iperf -t %s -c %s" % (options.time, first_node_address)
|
||||
)
|
||||
print(output)
|
||||
logging.info("node %s connecting to %s", last_node.name, first_node_address)
|
||||
output = last_node.node_net_cmd(f"iperf -t {options.time} -c {first_node_address}")
|
||||
logging.info(output)
|
||||
first_node.node_net_cmd("killall -9 iperf")
|
||||
|
||||
# shutdown session
|
||||
|
@ -59,9 +57,11 @@ def main():
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
options = parser.parse_options("switch")
|
||||
start = datetime.datetime.now()
|
||||
print("running switch example: nodes(%s) time(%s)" % (options.nodes, options.time))
|
||||
logging.info(
|
||||
"running switch example: nodes(%s) time(%s)", options.nodes, options.time
|
||||
)
|
||||
example(options)
|
||||
print("elapsed time: %s" % (datetime.datetime.now() - start))
|
||||
logging.info("elapsed time: %s", datetime.datetime.now() - start)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue