apps: don't attempt to del password key if it doesn't exist

This commit is contained in:
Alexandre Aubin 2023-06-14 15:47:17 +02:00
parent 48ee78afa2
commit 29338f79bc

View file

@ -1209,7 +1209,8 @@ def app_install(
for question in questions:
# Or should it be more generally question.redact ?
if question.type == "password":
del env_dict_for_logging[f"YNH_APP_ARG_{question.name.upper()}"]
if f"YNH_APP_ARG_{question.name.upper()}" in env_dict_for_logging:
del env_dict_for_logging[f"YNH_APP_ARG_{question.name.upper()}"]
if question.name in env_dict_for_logging:
del env_dict_for_logging[question.name]