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

Refactor get_firewall_info function to fetch system information for a… #81

Closed cdot65 closed 6 months ago

cdot65 commented 6 months ago

Overview

This pull request introduces multi-threading to the get_firewall_info function, significantly improving its performance by enabling concurrent fetching of system information for firewalls managed by Panorama. This enhancement addresses the performance bottleneck identified in issue #[Issue Number], where the sequential processing of firewalls was leading to increased execution times, especially in environments with a large number of managed firewalls.

Changes

Performance Impact

Initial tests have shown a substantial reduction in execution time for the get_firewalls_info function, particularly in scenarios with a high number of firewalls. This improvement not only enhances the efficiency of operations that rely on this function but also contributes to a better user experience by reducing wait times.

Testing

Comprehensive testing has been conducted to ensure that the new multi-threaded approach delivers the expected performance improvements without compromising the accuracy of the fetched firewall information.

Additional tests have been added to cover edge cases, error handling, and scenarios with varying numbers of firewalls to ensure reliability and robustness.

Backward Compatibility

The changes introduced in this pull request are backward compatible. The external interface and return type of the get_firewalls_info function remain unchanged, ensuring that existing code relying on this function will continue to work as expected.

Future Considerations

Monitoring and tuning the max_workers parameter based on real-world usage patterns and system resource availability. Exploring further optimizations and enhancements in error handling and data aggregation techniques.

This pull request represents a significant step forward in optimizing the performance of firewall management tasks and is a direct response to the needs identified by the community and users of the system.