91 enhancement check for preempt setting in ha configuration before upgrade #92
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.
Summary
This pull request includes a series of updates aimed at enhancing functionality and improving the clarity of the codebase related to firewall information retrieval and processing. Key changes include renaming critical functions for consistency and clarity, incorporating High Availability (HA) status retrieval into the firewall mapping process, and updating command functionalities to accommodate new features.
Changes
Function Renaming: To improve code readability and maintain consistency, we've renamed get_firewalls_info to threaded_get_firewall_details. This change better reflects the function's purpose and its threaded nature of operation.
Consolidation of Functionality: The fetch_firewall_info function has been renamed to get_firewall_details to unify naming conventions across the codebase. This function's renaming is part of an effort to streamline function names and enhance code maintainability.
Enhanced HA Status Retrieval: We've added functionality to retrieve and append HA status information (get_ha_status) to the firewall_mapping. This enhancement allows for a more comprehensive overview of firewall configurations and HA statuses, aiding in more informed decision-making processes.
Command Updates: The
show devices all
command was replaced withshow devices connected
to preventing invalid target firewalls from being added to the interactive menu selection page.Preempt Verification: If the user selected firewalls within an HA pair with
preempt
enabled, prompt the user to verify that they really want to add these devices to the list of firewalls. There are instances wherepreempt
enabled can cause disruption after an upgrade completes.Motivation
The motivation behind these changes is to enhance the tool's functionality, particularly in how it retrieves and presents firewall details, including HA status. By renaming functions for clarity and adding preemptive status checks, we aim to provide a more intuitive and comprehensive tool for managing firewall configurations and statuses.
Testing
Changes have been tested locally to ensure functionality remains intact and no regressions are introduced. Tests included verifying the correct execution of renamed functions, the successful retrieval and display of HA status in firewall mappings, and the expected output from updated commands.
Impact
These changes are backward compatible, with no expected disruption to existing workflows. Users may need to familiarize themselves with the renamed functions and the additional HA status information available in command outputs.