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
43 stars 9 forks source link

add Panorama license check #111

Closed cdot65 closed 8 months ago

cdot65 commented 8 months ago

Checklist for This Pull Request

🚨Please adhere to the guidelines for contributing to this repository.

Pull Request Description

Implemented a check to validate that Panorama appliances are active in their licenses before upgrading. Our dependency of Upgrade Assurance package prevents us from running the readiness checks on Panorama appliances, so we have instead used the op method to perform request license info and perform validation on the response object.

The script will gracefully exit if there is no license info:

<response status="success">
    <result>
        <licenses></licenses>
    </result>
</response>

Or if the license entries are expired

<response status="success">
    <result>
        <licenses>
            <entry>
                <feature>Device Management License</feature>
                <description>VM Panorama license to manage up to 25 devices</description>
                <serial>0007EV12345</serial>
                <issued>February 03, 1999</issued>
                <expired>yes</expired>
                <authcode>I5012345</authcode>
            </entry>
            <entry>
                <feature>Premium</feature>
                <description>24 x 7 phone support; advanced replacement hardware service</description>
                <serial>0007EV48639</serial>
                <issued>February 03, 1999</issued>
                <expires>February 01, 2020</expires>
                <expired>yes</expired>
                <authcode>F2312345</authcode>
            </entry>
        </licenses>
    </result>
</response>

Otherwise the upgrade will continue.

What does this pull request accomplish?

Are there any breaking changes included?

Is there anything the reviewers should know?

Thank you for your contributions!