feat: add more debbug

This commit is contained in:
dettlaff 2024-11-27 17:18:08 +04:00
parent cb9e5c1307
commit 6b95d590aa

View file

@ -45,18 +45,37 @@ class KanidmAdminToken:
with temporary_env_var(key="KANIDM_PASSWORD", value=kanidm_admin_password):
subprocess.run(["kanidm", "login", "-D", "idm_admin"])
kanidm_admin_token = subprocess.check_output(
[
"kanidm",
"service-account",
"api-token",
"generate",
"--rw",
"selfprivacy",
"token2",
],
text=True,
)
# kanidm_admin_token = subprocess.check_output(
# [
# "kanidm",
# "service-account",
# "api-token",
# "generate",
# "--rw",
# "selfprivacy",
# "token2",
# ],
# text=True,
# )
try:
kanidm_admin_token = subprocess.check_output(
[
"kanidm",
"service-account",
"api-token",
"generate",
"--rw",
"selfprivacy",
"token2",
],
text=True,
stderr=subprocess.PIPE,
)
except subprocess.CalledProcessError as e:
logging.error(f"Error executing command: {e.cmd}")
logging.error(f"Error message: {e.stderr}")
raise
# except subprocess.CalledProcessError as e:
# logger.error(e)