PaloAltoNetworks / pan-os-python

The PAN-OS SDK for Python is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.
https://pan-os-python.readthedocs.io
ISC License
341 stars 169 forks source link

AttributeError when using Panorama.refresh_devices() if there are some pre-registered firewalls not yet connected to Panorama #439

Closed AnthoBalitrand closed 2 years ago

AnthoBalitrand commented 2 years ago

Describe the bug

If there are some firewalls pre-registered on Panorama (using the "Add" button on the "Managed Devices" menu), but which yet never connected to Panorama (awaiting deployment), it causes an AttributeError on the refresh_devices() function which is trying to split the PAN-OS version value of the device while it's not yet known.

Current behavior

>>> pano.refresh_devices(expand_vsys=False, include_device_groups=False) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/to148757/PycharmProjects/pan-os-python/panos/panorama.py", line 701, in refresh_devices firewall_instances = tmp_fw.refreshall_from_xml( File "/Users/to148757/PycharmProjects/pan-os-python/panos/firewall.py", line 403, in refreshall_from_xml fw._set_version_and_version_info(entry.findtext("sw-version")) File "/Users/to148757/PycharmProjects/pan-os-python/panos/base.py", line 4234, in _set_version_and_version_info tokens = self.version.split(".")[:3] AttributeError: 'NoneType' object has no attribute 'split'

welcome-to-palo-alto-networks[bot] commented 2 years ago

:tada: Thanks for opening your first issue here! Welcome to the community!

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.7.1 :tada:

The release is available on PyPI and GitHub release

Posted by semantic-release bot