summaryrefslogtreecommitdiff
path: root/bin/taler-deployment-config-instances
diff options
context:
space:
mode:
Diffstat (limited to 'bin/taler-deployment-config-instances')
-rwxr-xr-xbin/taler-deployment-config-instances20
1 files changed, 13 insertions, 7 deletions
diff --git a/bin/taler-deployment-config-instances b/bin/taler-deployment-config-instances
index ad1feec..27c5c17 100755
--- a/bin/taler-deployment-config-instances
+++ b/bin/taler-deployment-config-instances
@@ -47,11 +47,11 @@ def wait_merchant_up():
# Ready.
print("Merchant is up and running")
- break
+ return True
if checks == 0:
- print("Could not start the merchant (with TALER_MERCHANT_TOKEN in the env).")
- exit(1)
+ print("Merchant is not correctly serving requests.")
+ return False
MERCHANT_BACKEND_BASE_URL = expect_env("TALER_ENV_MERCHANT_BACKEND")
@@ -140,7 +140,10 @@ def ensure_default_instance():
# Start the merchant natively.
merchant = Popen(["taler-merchant-httpd"], env=env_with_token)
- wait_merchant_up()
+ if not wait_merchant_up():
+ merchant.terminate()
+ merchant.wait()
+ exit(1)
print("Merchant started successfully, creating the default instance now.")
ensure_instance(
@@ -149,17 +152,20 @@ def ensure_default_instance():
payto_uris=[f"payto://x-taler-bank/bank.{TALER_ENV_NAME}.taler.net/Taler"],
auth=dict(method="token", token=TALER_ENV_FRONTENDS_APITOKEN)
)
-
+ # Native process can be terminated now.
merchant.terminate()
merchant.wait()
print("Merchant terminated, restarting it via ARM now.")
-
+ # Restarting the official ARM merchant.
system("taler-deployment-arm -i taler-merchant")
ensure_default_instance()
+
# Needs to wait here since the merchant got lastly restarted via ARM,
# in the previous operation.
-wait_merchant_up()
+if not wait_merchant_up():
+ system("taler-deployment-arm -k taler-merchant")
+ exit(1)
ensure_instance(
"blog",