You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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:
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
The text was updated successfully, but these errors were encountered: