Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/core/src/CoreMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions src/core/src/core_logic/PatchInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here stating why it is not marked error at this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

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

Expand Down