aboutsummaryrefslogtreecommitdiff
path: root/mknet
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-09-15 16:53:21 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-09-15 16:53:21 +0200
commitcfd3e500feb59ba3c1bd1247dac3b4537c8592ba (patch)
treea3e9a1b7ebf78b60b8fdc77fff1899a7f834509f /mknet
parent68cc7d635b25ca08da957541794df6a1cda2ef95 (diff)
downloadmknet-cfd3e500feb59ba3c1bd1247dac3b4537c8592ba.tar.gz
mknet-cfd3e500feb59ba3c1bd1247dac3b4537c8592ba.zip
run-all wait all processes before returning
Diffstat (limited to 'mknet')
-rwxr-xr-xmknet8
1 files changed, 6 insertions, 2 deletions
diff --git a/mknet b/mknet
index 34608a3..5c09a18 100755
--- a/mknet
+++ b/mknet
@@ -315,6 +315,7 @@ def runall(cmd):
zones = parse(config).zones
number = 1
+ wait_list = [ ]
for zone in zones.values():
if zone.is_zone():
for server in zone.servers.values():
@@ -325,7 +326,7 @@ def runall(cmd):
env["ID"] = str(number)
env["SERVER_COUNT"] = str(len(config['servers']))
name = f'testnet-{zone.name}-{server.name}'
- net.ns.run(name, cmd, env)
+ wait_list.append(net.ns.run(name, cmd, env))
number +=1
else:
env = os.environ.copy()
@@ -335,9 +336,12 @@ def runall(cmd):
env["ID"] = str(number)
env["SERVER_COUNT"] = str(len(config['servers']))
name = f'testnet-{zone.name}-{zone.name}'
- net.ns.run(name, cmd, env)
+ wait_list.append(net.ns.run(name, cmd, env))
first = False
number +=1
+ for p in wait_list:
+ p.wait()
+ print("runall done")
def destroy():
for ns in net.ns.list():