mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 12:46:39 +00:00
fix: add some debbug
This commit is contained in:
parent
833edab852
commit
fa17f18e0e
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue