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

Enhancements for PyPI Packaging and Improved Upgrade Process Handling #22

Closed cdot65 closed 8 months ago

cdot65 commented 8 months ago

Overview

This pull request introduces several key updates and enhancements to the pan-os-upgrade project, focusing on preparing the project for PyPI packaging and deployment. Additionally, it addresses important bug fixes and improvements in the upgrade process handling.

Key Changes

Preparation for PyPI Packaging

Upgrade Process Retry Mechanism:

Enhanced the perform_upgrade function to handle retries more effectively. This improvement is critical for scenarios where the software manager on the device is busy.

Implemented a robust retry mechanism with a configurable wait time, providing resilience in the upgrade process.

Fix for TypeError in Logging:

Resolved a TypeError caused by an incorrect file keyword argument in logging.error calls within the parse_arguments function.

Refactored the logging statements to comply with the standard logging module's API.

General Improvements:

General code refactoring and cleanup for better readability and maintenance.

Updated documentation and comments to reflect the latest changes. Testing and Validation:

Extensive testing was conducted to ensure that the package builds correctly and that the pan-os-upgrade script executes as expected.

Verified the functionality of the retry mechanism in the upgrade process under different scenarios.

Ensured compatibility and proper functioning of the package when installed through Poetry.

Request for Review

I request a thorough review of these changes from the maintainers.

Feedback, suggestions, and additional testing from the community are highly welcomed to ensure robustness and reliability.