commit 5b035f7d89005c089f79418ef09f9dbc4ce9095e
parent cc97757958a6c4dfafdedd0f4f742e7f9001cd94
Author: MS <ms@taler.net>
Date: Tue, 25 May 2021 14:11:24 +0200
Wait merchant to terminate
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/bin/taler-deployment-config-instances b/bin/taler-deployment-config-instances
@@ -13,6 +13,7 @@ from os import environ, system
from sys import exit
from urllib.parse import urljoin
from subprocess import Popen
+import psutil
def expect_env(name):
val = environ.get(name)
@@ -74,6 +75,14 @@ def ensure_instance(instance_id, name, payto_uris, auth):
def ensure_default_instance():
system("taler-deployment-arm -k taler-merchant")
+ # Wait that merchant actually terminated.
+ still_running = True
+ while still_running:
+ for proc in psutil.process_iter():
+ if proc.name() == "taler-merchant-httpd":
+ sleep(1)
+ break
+ still_running = False
env_with_token = environ.copy()
env_with_token["TALER_MERCHANT_TOKEN"] = TALER_ENV_FRONTENDS_APITOKEN
merchant = Popen(["taler-merchant-httpd"], env=env_with_token)