109 implement safeguards to prevent upgrades that may cause ha pair incompatibility #113
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.
Here's a refined PR description based on the provided GitHub issue and changes:
Checklist for This Pull Request
🚨Please adhere to the guidelines for contributing to this repository.
Pull Request Description
This pull request introduces a safeguard feature in the pan-os-upgrade tool to prevent compatibility issues when upgrading PAN-OS firewalls in an HA pair. The feature gracefully exits the upgrade process if the user selects an upgrade version that is two or more minor releases ahead of the current version and the firewalls are in an HA state.
What does this pull request accomplish?
Are there any breaking changes included?
Changes made in this pull request
check_ha_compatibility
to assess the compatibility of the target PAN-OS version with the current version in an HA pair.software_update_check
function to callcheck_ha_compatibility
when dealing with firewalls in an HA pair.False
, preventing the upgrade from proceeding.check_ha_compatibility
function to align with the project's documentation style.Resolves issue
Resolves #109
Motivation behind this feature
When upgrading PAN-OS firewalls in an HA pair, selecting a version that is two or more minor releases ahead of the current version can lead to compatibility issues. If one firewall is upgraded to a version that is significantly ahead of its peer, it may not be able to rejoin the HA pair after the upgrade, putting itself in a suspended state. When the upgrade process begins on the other firewall, it issues an HA state switch over. If the peer is in a suspended state, neither firewall will be able to forward traffic, as they both operate in a suspended state.
This safeguard feature mitigates this issue by gracefully exiting the upgrade process when the specified conditions are met. It helps prevent users from accidentally causing HA pair incompatibility issues and ensures they are aware of the potential consequences before proceeding with the upgrade.
Is there anything the reviewers should know?
Please review the changes carefully, especially the logic in the
check_ha_compatibility
function, to ensure it accurately identifies potential compatibility issues based on the version numbers and HA state.