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, stderr=subprocess.DEVNULL,
) )
new_kanidm_admin_password = re.search(r'{"password":"([^"]+)"}', output).group( new_kanidm_admin_password = re.findall(r'{"password":"([^"]+)"}', output)[-1]
1 # we have many not json strings in output
) # we have many not json strings in output
redis.set("kanidm:password", new_kanidm_admin_password) redis.set("kanidm:password", new_kanidm_admin_password)
return new_kanidm_admin_password return new_kanidm_admin_password