summaryrefslogtreecommitdiff
path: root/bin/taler-merchant-demos
diff options
context:
space:
mode:
Diffstat (limited to 'bin/taler-merchant-demos')
-rwxr-xr-xbin/taler-merchant-demos15
1 files changed, 7 insertions, 8 deletions
diff --git a/bin/taler-merchant-demos b/bin/taler-merchant-demos
index ade40cf..e7c3821 100755
--- a/bin/taler-merchant-demos
+++ b/bin/taler-merchant-demos
@@ -92,8 +92,7 @@ def handle_serve_http(config, which_shop, port=None):
def handle_serve_from_config(config_obj, which_shop):
try:
if config_obj.value_string(which_shop, "serve", required=True).lower() == "http":
- http_port = config_obj.value_int(which_shop, "port")
- return handle_serve_http(config_obj, which_shop, http_port)
+ return handle_serve_http(config_obj, which_shop)
handle_serve_uwsgi(config_obj, which_shop)
except ConfigurationError as ce:
print(ce)
@@ -104,12 +103,12 @@ def handle_serve_from_config(config_obj, which_shop):
@click.option("--http-port", help="HTTP port to serve (if not given, serving comes from config)", required=False, type=int)
@click.argument("which-shop")
def demos(config, http_port, which_shop):
- """
- WHICH_SHOP is one of: blog, donations, survey or landing.
- """
- if config:
- os.environ["TALER_CONFIG_FILE"] = config
- config_obj = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE"))
+ """WHICH_SHOP is one of: blog, donations, survey or landing."""
+
+ if which_shop not in ["blog", "donations", "survey"]:
+ print("Please use a valid shop name: blog, donations, survey.")
+ sys.exit(1)
+ config_obj = TalerConfig.from_file(config)
if http_port:
return handle_serve_http(config_obj, which_shop, http_port)
handle_serve_from_config(config_obj, which_shop)