Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from standard to hotfix release fails on 1.12.0 #565

Open
timothyfranson opened this issue May 30, 2024 · 0 comments
Open

Upgrade from standard to hotfix release fails on 1.12.0 #565

timothyfranson opened this issue May 30, 2024 · 0 comments
Labels

Comments

@timothyfranson
Copy link

timothyfranson commented May 30, 2024

Describe the bug

Upgrade from non-hotifx to a hotfix release fails when pan-os-python==1.12.0

Reverting to pan-os-python 1.11.0 works just fine.

Expected behavior

Device is upgraded

Current behavior

Traceback (most recent call last):
  File ".../venv/lib/python3.11/site-packages/nornir/core/task.py", line 99, in start
    r = self.task(self, **self.params)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../panos_upgrade/run.py", line 197, in upgrade_device
    upgrade_successful = fw.software.upgrade_to_version(target_version)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../venv/lib/python3.11/site-packages/panos/updater.py", line 337, in upgrade_to_version
    elif not self._direct_upgrade_possible(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../venv/lib/python3.11/site-packages/panos/updater.py", line 519, in _direct_upgrade_possible
    and current_version.subrelease_num < target_version.subrelease_num
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'NoneType' and 'int'

Possible solution

Seems the issue is that there is no value for subrelease_num if not coming from a hotfix release. Either populate that with 0, or account for it in the conditional.

Some quick and dirty testing:

>>> from panos import PanOSVersion
>>> t = PanOSVersion("10.1.13-h1")
>>> c = PanOSVersion('10.1.13')
>>> t
PanOSVersion ('10.1.13-h1')
>>> c
PanOSVersion ('10.1.13')
>>> c.subrelease_num
>>> t.subrelease_num
1
>>>

Steps to reproduce

Try to upgrade a firewall from 10.1.13 to 10.1.13-h1 using upgrade_to_version()

Screenshots

n/a

Context

Cannot use this to apply hotfix releases if coming from a normal release.

Your Environment

  • Version used: 1.12.0
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3): python 3.11.9
  • Operating System and version (desktop or mobile): MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant