From 3349d05464c2826ed6c333930a11e8e4bfeff46a Mon Sep 17 00:00:00 2001 From: ms Date: Tue, 25 May 2021 23:24:49 +0200 Subject: helper function --- bin/taler-deployment-config-instances | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bin/taler-deployment-config-instances') diff --git a/bin/taler-deployment-config-instances b/bin/taler-deployment-config-instances index 5fe0800..162ae52 100755 --- a/bin/taler-deployment-config-instances +++ b/bin/taler-deployment-config-instances @@ -24,6 +24,11 @@ def expect_env(name): exit(1) return val +def wait_merchant(): + for proc in psutil.process_iter(): + if proc.name() == "taler-merchant-httpd" and proc.username == getuser(): + break + sleep(1) MERCHANT_BACKEND_BASE_URL = expect_env("TALER_ENV_MERCHANT_BACKEND") TALER_ENV_NAME = expect_env("TALER_ENV_NAME") @@ -86,9 +91,12 @@ def ensure_default_instance(): still_running = True sleep(1) break + env_with_token = environ.copy() env_with_token["TALER_MERCHANT_TOKEN"] = TALER_ENV_FRONTENDS_APITOKEN merchant = Popen(["taler-merchant-httpd"], env=env_with_token) + + wait_merchant() ensure_instance( "default", "default", @@ -100,6 +108,7 @@ def ensure_default_instance(): system("taler-deployment-arm -i taler-merchant") ensure_default_instance() +wait_merchant() ensure_instance( "blog", -- cgit v1.2.3