From fa17f18e0e37c687e2cbd720343d279519bc642d Mon Sep 17 00:00:00 2001 From: dettlaff Date: Fri, 22 Nov 2024 23:10:29 +0400 Subject: [PATCH] fix: add some debbug --- .../repositories/users/kanidm_user_repository.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/selfprivacy_api/repositories/users/kanidm_user_repository.py b/selfprivacy_api/repositories/users/kanidm_user_repository.py index 91ddd3d..1342f01 100644 --- a/selfprivacy_api/repositories/users/kanidm_user_repository.py +++ b/selfprivacy_api/repositories/users/kanidm_user_repository.py @@ -65,7 +65,6 @@ class KanidmAdminToken: "json", ], text=True, - stderr=subprocess.DEVNULL, ) except subprocess.CalledProcessError as e: print(e) @@ -86,14 +85,23 @@ class KanidmAdminToken: "json", ], text=True, - stderr=subprocess.DEVNULL, ) + os.system(f"echo '{output}' >> /root/output.txt)") + + output = output.decode("utf-8") + + os.system(f"echo '{output}' >> /root/outputde.txt)") + match = re.search(r'"password":"([^"]+)"', output) new_kanidm_admin_password = match.group( 1 ) # we have many not json strings in output + os.system( + f"echo '{new_kanidm_admin_password}' >> /root/new_kanidm_admin_password.txt)" + ) + redis.set("kanidm:password", new_kanidm_admin_password) return new_kanidm_admin_password