cdot65 / pan-os-upgrade

An efficient tool to execute configuration backups, network state snapshots, system readiness checks, and operating system upgrades of Palo Alto Networks firewalls and Panorama appliances.
https://cdot65.github.io/pan-os-upgrade/
Apache License 2.0
39 stars 7 forks source link

91 enhancement check for preempt setting in ha configuration before upgrade #92

Closed cdot65 closed 5 months ago

cdot65 commented 5 months ago

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 with show 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 where preempt 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.