From 3d414fc770482591869f30a1e0a66ca4e9d43cdc Mon Sep 17 00:00:00 2001 From: Keith Suderman Date: Tue, 4 Oct 2022 18:44:01 -0400 Subject: [PATCH] Output JSON from user create command --- abm/lib/users.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/abm/lib/users.py b/abm/lib/users.py index b1d308b..2ff1d4d 100644 --- a/abm/lib/users.py +++ b/abm/lib/users.py @@ -57,4 +57,10 @@ def create(context: Context, args:list): user_record = gi.users.create_local_user(name, email, password) id = user_record['id'] key = gi.users.create_user_apikey(id) - print(f"Created user {name} with API key {key}") + result = { + 'name': name, + 'email': email, + 'id': id, + 'key': key + } + print(json.dumps(result, indent=4))