diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-08-23 11:58:15 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-08-23 11:58:15 +0200 |
commit | 063e68ec063ea29e32da920de83dbdad3fec185e (patch) | |
tree | 04249bcf234a5cd0c78f8be5b468000b22a33e58 /bin/taler-merchant-demos | |
parent | c98bc6176d7911282624eaf398a1bea83c512fda (diff) | |
download | taler-merchant-demos-063e68ec063ea29e32da920de83dbdad3fec185e.tar.gz taler-merchant-demos-063e68ec063ea29e32da920de83dbdad3fec185e.tar.bz2 taler-merchant-demos-063e68ec063ea29e32da920de83dbdad3fec185e.zip |
fix #6510
Diffstat (limited to 'bin/taler-merchant-demos')
-rwxr-xr-x | bin/taler-merchant-demos | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/bin/taler-merchant-demos b/bin/taler-merchant-demos index b4ac156..098416a 100755 --- a/bin/taler-merchant-demos +++ b/bin/taler-merchant-demos @@ -59,7 +59,11 @@ def handle_serve_uwsgi(config, whichShop): params.extend(["--chmod-socket="+mode]) os.makedirs(os.path.dirname(spec), exist_ok=True) logging.info("launching uwsgi with argv %s", params[1:]) - os.execlp(*params) + try: + os.execlp(*params) + except: + echo "Failed to start uwsgi. Please make sure to install uwsgi for Python3." + sys.exit(1) ## # This function interprets the 'serve-http' subcommand. @@ -70,12 +74,16 @@ def handle_serve_http(config, whichShop, port=None): if port is None: port = config[whichShop]["http_port"].value_int(required=True) spec = ":%d" % (port,) - os.execlp("uwsgi", "uwsgi", - "--master", - "--die-on-term", - "--log-format", UWSGI_LOGFMT, - "--http", spec, - "--module", "talermerchantdemos.{}:app".format(whichShop)) + try: + os.execlp("uwsgi", "uwsgi", + "--master", + "--die-on-term", + "--log-format", UWSGI_LOGFMT, + "--http", spec, + "--module", "talermerchantdemos.{}:app".format(whichShop)) + except: + echo "Failed to start uwsgi. Please make sure to install uwsgi for Python3." + sys.exit(1) @click.command("Global shop launcher") @click.option("--config", help="Configuration file", required=False) @@ -92,7 +100,7 @@ def demos(config, serve_http, port, serve_uwsgi, which_shop): config_obj = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE")) if serve_http: # port was given handle_serve_http(config_obj, which_shop, port) - return - handle_serve_uwsgi(config_obj, which_shop) + else: + handle_serve_uwsgi(config_obj, which_shop) demos() |