From ffb4b624fc8bfd870958976ec25b74677e740841 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 17 Sep 2019 15:12:28 -0400 Subject: [PATCH] Re-order tasks.restore_pkcs11_modules() to run earlier It was executed after restore_all_files() so PKCS11_MODULES was already restored so that part was a no-op, but the redhat restore_pkcs11_modules() also calls unlink() on each restored file so basically the file would be restored, unlinked, then since it was already restored, skipped. By moving the call to restore_pkcs11_modules() earlier it can do the expected restoration properly. https://pagure.io/freeipa/issue/8034 Signed-off-by: Rob Crittenden Reviewed-By: Florence Blanc-Renaud --- ipaserver/install/server/install.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py index 6a81d5780..7cdf2a510 100644 --- a/ipaserver/install/server/install.py +++ b/ipaserver/install/server/install.py @@ -1145,6 +1145,7 @@ def uninstall(installer): custodiainstance.CustodiaInstance(realm='REALM.INVALID').uninstall() otpdinstance.OtpdInstance().uninstall() tasks.restore_hostname(fstore, sstore) + tasks.restore_pkcs11_modules(fstore) fstore.restore_all_files() try: os.remove(paths.ROOT_IPA_CACHE) @@ -1169,8 +1170,6 @@ def uninstall(installer): # remove upgrade state file sysupgrade.remove_upgrade_file() - tasks.restore_pkcs11_modules(fstore) - if fstore.has_files(): logger.error('Some files have not been restored, see ' '%s/sysrestore.index', SYSRESTORE_DIR_PATH)