diff --git a/src/core/src/CoreMain.py b/src/core/src/CoreMain.py index e62757a5..57511a15 100644 --- a/src/core/src/CoreMain.py +++ b/src/core/src/CoreMain.py @@ -84,6 +84,7 @@ def __init__(self, argv): if patch_assessment_successful and patch_installation_successful: patch_installer.mark_installation_completed() overall_patch_installation_operation_successful = True + self.update_patch_substatus_if_pending(patch_operation_requested, overall_patch_installation_operation_successful, patch_assessment_successful, configure_patching_successful, status_handler, composite_logger) except Exception as error: # Privileged operation handling for non-production use @@ -129,6 +130,7 @@ def update_patch_substatus_if_pending(patch_operation_requested, overall_patch_i if not patch_assessment_successful: status_handler.add_error_to_status("Installation failed due to assessment failure. Please refer the error details in assessment substatus") status_handler.set_installation_substatus_json(status=Constants.STATUS_ERROR) + # NOTE: For auto patching requests, no need to report patch metadata to health store in case of failure composite_logger.log_debug(' -- Persisted failed installation substatus.') if not patch_assessment_successful and patch_operation_requested != Constants.CONFIGURE_PATCHING.lower(): status_handler.set_assessment_substatus_json(status=Constants.STATUS_ERROR) diff --git a/src/core/src/core_logic/PatchInstaller.py b/src/core/src/core_logic/PatchInstaller.py index 022544d3..d0c795fe 100644 --- a/src/core/src/core_logic/PatchInstaller.py +++ b/src/core/src/core_logic/PatchInstaller.py @@ -94,10 +94,7 @@ def start_installation(self, simulate=False): # Combining maintenance overall_patch_installation_successful = bool(update_run_successful and not maintenance_window_exceeded) - - if not overall_patch_installation_successful: - self.status_handler.set_installation_substatus_json(status=Constants.STATUS_ERROR) - # NOTE: For auto patching requests, no need to report patch metadata to healthstore in case of failure + # NOTE: Not updating installation substatus at this point because we need to wait for the implicit/second assessment to complete first, as per CRP's instructions return overall_patch_installation_successful