<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic pan-os-python Panorama set_ha_peers() method not working in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/pan-os-python-panorama-set-ha-peers-method-not-working/m-p/563900#M114236</link>
    <description>&lt;P&gt;The document I'm referring to -&amp;nbsp;&lt;A href="https://pan-os-python.readthedocs.io/en/latest/howto.html" target="_blank" rel="noopener"&gt;https://pan-os-python.readthedocs.io/en/latest/howto.html&lt;/A&gt;&amp;nbsp;&amp;gt;&amp;nbsp;&lt;STRONG&gt;High Availability Pairs&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've been working with the &lt;CODE&gt;pan-os-python&lt;/CODE&gt; SDK, specifically with a Panorama High Availability (HA) pair. I'm following the documentation that guides on using specific methods with 'firewall pairs'. The primary advantage, as described in the documentation, is that these methods handle sending configurations to the currently 'active' device, eliminating the need for manual specification.&lt;/P&gt;
&lt;P&gt;However, I've encountered a problem when trying to use these methods with my 'Panorama HA pair'. Here's the error I'm getting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    if super_method_name not in ("keygen", "op", "ad_hoc", "export")
RecursionError: maximum recursion depth exceeded in comparison&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to note a couple of things:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I can successfully configure each Panorama device directly without resorting to the HA pair methods. For instance, if I set &lt;CODE&gt;panorama-1&lt;/CODE&gt; as active, I'm able to push configurations to it. The same goes for &lt;CODE&gt;panorama-2&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;This behaviour confirms that there are no access or permission issues between my environment and the Panorama devices.&lt;/LI&gt;
&lt;LI&gt;Also confirms the code is working without using the ha_pair method&lt;/LI&gt;
&lt;LI&gt;If I target Firewalls then it does work&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Considering the above, has anyone experienced a similar issue or could provide some insights into what might be causing this? Any help or pointers would be much appreciated! Here is the code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from panos.panorama import Panorama, DeviceGroup
from panos.policies import PreRulebase, SecurityRule

panorama_object = Panorama('panorama-1', 'username', 'password' )
panorama_object.set_ha_peers(Panorama('panorama-2', 'username', 'password'))
panorama_object.refresh_ha_active()

dg_object = DeviceGroup("office")
panorama_object.add(dg_object)

rules_object = dg_object.add(PreRulebase())
new_rule_object = SecurityRule(
    name='Allow DNS',
    fromzone=['any'],
    tozone=['any'],
    source=['any'],
    destination=['8.8.8.8'],
    application=['dns'],
    service=['application-default'],
    action='allow'
)

rules_object.add(new_rule_object)
new_rule_object.create()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Nov 2023 16:06:51 GMT</pubDate>
    <dc:creator>vsurresh</dc:creator>
    <dc:date>2023-11-01T16:06:51Z</dc:date>
    <item>
      <title>pan-os-python Panorama set_ha_peers() method not working</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/pan-os-python-panorama-set-ha-peers-method-not-working/m-p/563900#M114236</link>
      <description>&lt;P&gt;The document I'm referring to -&amp;nbsp;&lt;A href="https://pan-os-python.readthedocs.io/en/latest/howto.html" target="_blank" rel="noopener"&gt;https://pan-os-python.readthedocs.io/en/latest/howto.html&lt;/A&gt;&amp;nbsp;&amp;gt;&amp;nbsp;&lt;STRONG&gt;High Availability Pairs&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've been working with the &lt;CODE&gt;pan-os-python&lt;/CODE&gt; SDK, specifically with a Panorama High Availability (HA) pair. I'm following the documentation that guides on using specific methods with 'firewall pairs'. The primary advantage, as described in the documentation, is that these methods handle sending configurations to the currently 'active' device, eliminating the need for manual specification.&lt;/P&gt;
&lt;P&gt;However, I've encountered a problem when trying to use these methods with my 'Panorama HA pair'. Here's the error I'm getting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    if super_method_name not in ("keygen", "op", "ad_hoc", "export")
RecursionError: maximum recursion depth exceeded in comparison&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to note a couple of things:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I can successfully configure each Panorama device directly without resorting to the HA pair methods. For instance, if I set &lt;CODE&gt;panorama-1&lt;/CODE&gt; as active, I'm able to push configurations to it. The same goes for &lt;CODE&gt;panorama-2&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;This behaviour confirms that there are no access or permission issues between my environment and the Panorama devices.&lt;/LI&gt;
&lt;LI&gt;Also confirms the code is working without using the ha_pair method&lt;/LI&gt;
&lt;LI&gt;If I target Firewalls then it does work&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Considering the above, has anyone experienced a similar issue or could provide some insights into what might be causing this? Any help or pointers would be much appreciated! Here is the code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from panos.panorama import Panorama, DeviceGroup
from panos.policies import PreRulebase, SecurityRule

panorama_object = Panorama('panorama-1', 'username', 'password' )
panorama_object.set_ha_peers(Panorama('panorama-2', 'username', 'password'))
panorama_object.refresh_ha_active()

dg_object = DeviceGroup("office")
panorama_object.add(dg_object)

rules_object = dg_object.add(PreRulebase())
new_rule_object = SecurityRule(
    name='Allow DNS',
    fromzone=['any'],
    tozone=['any'],
    source=['any'],
    destination=['8.8.8.8'],
    application=['dns'],
    service=['application-default'],
    action='allow'
)

rules_object.add(new_rule_object)
new_rule_object.create()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 16:06:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/pan-os-python-panorama-set-ha-peers-method-not-working/m-p/563900#M114236</guid>
      <dc:creator>vsurresh</dc:creator>
      <dc:date>2023-11-01T16:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: pan-os-python Panorama set_ha_peers() method not working</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/pan-os-python-panorama-set-ha-peers-method-not-working/m-p/564829#M114278</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/159288"&gt;@vsurresh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've reached out internally to assist you with this. Thanks for your patience!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 16:18:59 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/pan-os-python-panorama-set-ha-peers-method-not-working/m-p/564829#M114278</guid>
      <dc:creator>JayGolf</dc:creator>
      <dc:date>2023-11-08T16:18:59Z</dc:date>
    </item>
  </channel>
</rss>

