backport: Wait for host to be in result state (#621) #667
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug introduced in #580.
The update_available is false just after the upgrade, and
HOST_UPGRADE_FINISHED_AND_WILL_BE_REBOOTED is logged. But the host is
not yet rebooted, so we still need to wait for the status to be UP or
MAINTENANCE.
Signed-off-by: Martin Nečas [email protected]
In #580 we introduced a check on update_available state of the host to
determine if the host upgrade finished when there were no updates
available for te host.
The downside of this is that when the update finishes, the
update_available flag is cleared, and ansible thinks the host upgrade is
complete and starts upgrading the next node. But the reboot is not
completed yet, so result_state != h.status.
The fix here is to save the update_available status before starting the
update. If there were no updates and status hasn't changed, then it goes
on. If there was an update on the other hand, it will wait for the
HOST_UPGRADE_FAILED / HOST_UPGRADE_FINISHED /
HOST_UPGRADE_FINISHED_AND_WILL_BE_REBOOTED events.
Signed-off-by: Jean-Louis Dupond [email protected]
Signed-off-by: Martin Nečas [email protected]
Signed-off-by: Martin Nečas [email protected]
Signed-off-by: Jean-Louis Dupond [email protected]
Co-authored-by: Martin Nečas [email protected]