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
340 stars 168 forks source link

Modifier calls fail on DeviceGroup when FW is a child #501

Open Coo101 opened 1 year ago

Coo101 commented 1 year ago

Describe the bug

When trying to do a call for a devicegroup that modifies the live device and a Firewall object is attached it errors out TypeError: Firewall.element() got an unexpected keyword argument 'comparable'

Expected behavior

update the device

Current behavior

Even a simple refresh and apply fails

Possible solution

Steps to reproduce

devicegroup= DeviceGroup('dg-name') panorama.add(devicegroup) devicegroup.refresh() devicegroup.apply()

Screenshots

Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm 2022.2\plugins\python\helpers\pydev_pydevd_bundle\pydevd_exec2.py", line 3, in Exec exec(exp, global_vars, local_vars) File "", line 1, in File "%localpath%\Anaconda3\envs\KNIME\Lib\site-packages\panos\base.py", line 625, in apply self.xpath(), self.element_str(), retry_on_peer=self.HA_SYNC ^^^^^^^^^^^^^^^^^^ File "%localpath%\Anaconda3\envs\KNIME\Lib\site-packages\panos\base.py", line 535, in element_str return ET.tostring(self.element(), encoding="utf-8") ^^^^^^^^^^^^^^ File "%localpath%\Anaconda3\envs\KNIME\Lib\site-packages\panos\base.py", line 2606, in element self.xml_merge(ans, itertools.chain(*iterchain)) File "%localpath%\Anaconda3\envs\KNIME\Lib\site-packages\panos\base.py", line 1694, in xml_merge for e in elements: File "%localpath%\Anaconda3\envs\KNIME\Lib\site-packages\panos\base.py", line 574, in _subelements e.append(child.element(comparable=comparable)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Firewall.element() got an unexpected keyword argument 'comparable'

Your Environment

Using Anaconda3

welcome-to-palo-alto-networks[bot] commented 1 year ago

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