The answerfile is not persistent
Closed this issue · 2 comments
Actual behavior
The generated answerfile doesn't keep answered questiones when any errors happens during processing of actors before reaching the report phase (probably not 100% accurate descr., but msg is that in case of error there is big chance the answerfile will be empty and answered questions will be forgotten.
To Reproduce
# on prepared system for upgrade
leapp preupgrade
cat /var/log/leapp/answerfile
[remove_pam_pkcs11_module_check]
# Title: None
# Reason: Confirmation
# =================== remove_pam_pkcs11_module_check.confirm ==================
# Label: Disable pam_pkcs11 module in PAM configuration? If no, the upgrade process will be interrupted.
# Description: PAM module pam_pkcs11 is no longer available in RHEL-8 since it was replaced by SSSD.
# Type: bool
# Default: None
# Available choices: True/False
# Unanswered question. Uncomment the following line with your answer
# confirm =
leapp answer --section remove_pam_pkcs11_module_check.confirm=True
cat /var/log/leapp/answerfile
[remove_pam_pkcs11_module_check]
confirm = True
# e.g. unsubscribe system - or you can do whatever to raise an error in early actors
# and run leapp again
leapp preupgrade
# cat /var/log/leapp/answerfile # (the file is empty)
# make the system ubgradable again and run leapp again..
leapp preupgrade
cat /var/log/leapp/answerfile # answers are lost
[remove_pam_pkcs11_module_check]
# Title: None
# Reason: Confirmation
# =================== remove_pam_pkcs11_module_check.confirm ==================
# Label: Disable pam_pkcs11 module in PAM configuration? If no, the upgrade process will be interrupted.
# Description: PAM module pam_pkcs11 is no longer available in RHEL-8 since it was replaced by SSSD.
# Type: bool
# Default: None
# Available choices: True/False
# Unanswered question. Uncomment the following line with your answer
# confirm =
Expected behavior
Answers are not lost.
System information (please complete the following information):
- upstream leapp
leapp-repository-*.PR441.*
Note: as well, the issue could be reproduced when an actor just do not request the dialog. e.g., we skip those transaction phases where could be actor raising dialog, because of networking issue e.g. so in such case, I believe we could see similar issue as well.
Resolved in th PR #600 - introduced answer.userchoices
file (or similar name..). The answers are stored in the file. If some answers are in the answerfile, these are copied into the userchoices file as well. When execution starts, answers from the userchoices are used if missing in the answerfile.
(just summary msg; read the pr and commit msgs to see more).