fix: re search

This commit is contained in:
dettlaff 2024-11-21 22:05:07 +04:00
parent b9ee8fad91
commit 8495c632d5

View file

@ -89,9 +89,8 @@ class KanidmAdminToken:
stderr=subprocess.DEVNULL,
)
new_kanidm_admin_password = re.search(r'{"password":"([^"]+)"}', output).group(
1
) # we have many not json strings in output
new_kanidm_admin_password = re.findall(r'{"password":"([^"]+)"}', output)[-1]
# we have many not json strings in output
redis.set("kanidm:password", new_kanidm_admin_password)
return new_kanidm_admin_password