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/en/latest/howto.html > High Availability Pairs
As per this guide, I can use the set_ha_peers() method directly on the Firewalls and push the configs to the currently active device. However, if I use it with Pannorama, it doesn't work.
Expected behavior
My understanding is that the method could also work with Panorama.
Current behavior
Just using this code as an example, I'm getting the below error (Same issue on Python 3.9 or 3.11)
Traceback (most recent call last):
File "/Users/suresh/Documents/panos-python-training/panorama_rules.py", line 30, in <module>
new_rule_object.create()
File "/Users/suresh/Library/Python/3.9/lib/python/site-packages/panos/base.py", line 652, in create
device.active().xapi.set(
File "/Users/suresh/Library/Python/3.9/lib/python/site-packages/panos/base.py", line 3859, in method
result = getattr(ha_peer.xapi, super_method_name)(*args, **kwargs)
File "/Users/suresh/Library/Python/3.9/lib/python/site-packages/panos/base.py", line 3859, in method
result = getattr(ha_peer.xapi, super_method_name)(*args, **kwargs)
File "/Users/suresh/Library/Python/3.9/lib/python/site-packages/panos/base.py", line 3859, in method
result = getattr(ha_peer.xapi, super_method_name)(*args, **kwargs)
[Previous line repeated 994 more times]
File "/Users/suresh/Library/Python/3.9/lib/python/site-packages/panos/base.py", line 3805, in method
if super_method_name not in ("keygen", "op", "ad_hoc", "export")
RecursionError: maximum recursion depth exceeded in comparison
Possible solution
Can we use the same method with Panorama too? I can still call the methods such as active() or passive() after running refresh_ha_active() method. For example, panorama_object.active() will return the current active Panorama.
Describe the bug
https://pan-os-python.readthedocs.io/en/latest/howto.html > High Availability Pairs As per this guide, I can use the
set_ha_peers()
method directly on the Firewalls and push the configs to the currently active device. However, if I use it with Pannorama, it doesn't work.Expected behavior
My understanding is that the method could also work with Panorama.
Current behavior
Just using this code as an example, I'm getting the below error (Same issue on Python 3.9 or 3.11)
Possible solution
Can we use the same method with Panorama too? I can still call the methods such as
active()
orpassive()
after runningrefresh_ha_active()
method. For example,panorama_object.active()
will return the current active Panorama.Steps to reproduce
I explained the issue here in detail with the sample code block - https://live.paloaltonetworks.com/t5/general-topics/pan-os-python-panorama-set-ha-peers-method-not-working/td-p/563900
Context
We have active/passive Panorama so, it would be good to get this working so, the configs are pushed to the current active device automatically.
Your Environment