Print json-serializable in adduser and showgroup

json-serialize-output
blallo 2020-11-20 12:02:29 +01:00
parent 8fbf159461
commit 2f2142025f
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F
1 changed files with 5 additions and 3 deletions

View File

@ -63,8 +63,10 @@ def adduser(uid):
# Check
user = get_user_by_uid(client, uid)
print()
print(pp(user))
if not SHOW_PASSWORDS:
user.pop("password")
print(JSON_ENC.encode(sanitize(user)))
@cli.register("delete an user", ["user identifier"])
@ -89,7 +91,7 @@ def showgroup(cn):
print("Group {} not found".format(gcn))
return
print(pp(group))
print(JSON_ENC.encode(sanitize(group)))
@cli.register("list all groups")