commit 91748a2896b993d1d24f0e6a23f202d390fac935
parent 58181b7702db1d082e772d85197a36c1fd6bf706
Author: MS <ms@taler.net>
Date: Tue, 26 Jan 2021 17:19:04 +0100
cli
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/cli/bin/libeufin-cli b/cli/bin/libeufin-cli
@@ -13,10 +13,11 @@ from getpass import getpass
def tell_user(resp, withsuccess=False):
- if resp.status_code == 200 and not withsuccess:
+ if resp.status_code != 200:
+ print(resp.content.decode("utf-8"))
return
- print(resp.content.decode("utf-8"))
-
+ if withsuccess:
+ print(resp.content.decode("utf-8"))
# FIXME: deprecate this in favor of NexusContext
def fetch_env():
@@ -83,8 +84,7 @@ def list_users(obj):
print("Could not reach nexus at " + url)
exit(1)
- print(resp.content.decode("utf-8"))
-
+ tell_user(resp, withsuccess=True)
@users.command(help="Change user's password")
@click.option(
@@ -109,7 +109,7 @@ def change_password(obj, new_password):
print("Could not reach nexus at " + url)
exit(1)
- tell_user(resp)
+ tell_user(resp, withsuccess=True)
@users.command("create", help="Create a new user")