<?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 pandevice set_zone error in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pandevice-set-zone-error/m-p/333709#M2383</link>
    <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using pandevice, I am able to add a tunnel interface, give it and IP, comment, and set the virtual router. using the set_virtual_router() function. However when trying the set_zone() function to set the security zone, I get an error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;previous code removed&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;#Create a network interface object named tunnl.[TunnelID]&lt;BR /&gt;tun = network.TunnelInterface(TunnelID,ip=DATACENTER_TUN_INTF,comment=TUN_COMMENT)&lt;BR /&gt;#Add the tunnel object to the Template object and create it.&lt;BR /&gt;Template_obj.add(tun).create()&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;TUN_ZONE='internal'&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;tun.set_virtual_router(DC_VR,refresh=True,update=True,running_config=True)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;#everything is good up until this point&lt;BR /&gt;tun.set_zone(TUN_ZONE,refresh=True,update=True,running_config=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I get when I run the code:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/base.py", line 2447, in _get_param_specific_info&lt;BR /&gt;p = token.format(**{})&lt;/P&gt;&lt;P&gt;KeyError: 'mode'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/src/scratch.py", line 313, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/src/scratch.py", line 280, in main&lt;BR /&gt;tun.set_zone('zap',refresh=True,update=True,running_config=True)&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/network.py", line 325, in set_zone&lt;BR /&gt;update, running_config, return_type, False, mode=mode)&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/base.py", line 1522, in _set_reference&lt;BR /&gt;obj.update(reference_var)&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/base.py", line 621, in update&lt;BR /&gt;path, value, var_path = self._get_param_specific_info(variable)&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/base.py", line 2455, in _get_param_specific_info&lt;BR /&gt;raise ValueError(msg.format(param, param_ref))&lt;/P&gt;&lt;P&gt;ValueError: While updating variable interface, missing replacement variable mode in path&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be most appreciated. Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2020 20:08:36 GMT</pubDate>
    <dc:creator>mrzepa2</dc:creator>
    <dc:date>2020-06-16T20:08:36Z</dc:date>
    <item>
      <title>pandevice set_zone error</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pandevice-set-zone-error/m-p/333709#M2383</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using pandevice, I am able to add a tunnel interface, give it and IP, comment, and set the virtual router. using the set_virtual_router() function. However when trying the set_zone() function to set the security zone, I get an error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;previous code removed&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;#Create a network interface object named tunnl.[TunnelID]&lt;BR /&gt;tun = network.TunnelInterface(TunnelID,ip=DATACENTER_TUN_INTF,comment=TUN_COMMENT)&lt;BR /&gt;#Add the tunnel object to the Template object and create it.&lt;BR /&gt;Template_obj.add(tun).create()&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;TUN_ZONE='internal'&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;tun.set_virtual_router(DC_VR,refresh=True,update=True,running_config=True)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;#everything is good up until this point&lt;BR /&gt;tun.set_zone(TUN_ZONE,refresh=True,update=True,running_config=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I get when I run the code:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/base.py", line 2447, in _get_param_specific_info&lt;BR /&gt;p = token.format(**{})&lt;/P&gt;&lt;P&gt;KeyError: 'mode'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/src/scratch.py", line 313, in &amp;lt;module&amp;gt;&lt;BR /&gt;main()&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/src/scratch.py", line 280, in main&lt;BR /&gt;tun.set_zone('zap',refresh=True,update=True,running_config=True)&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/network.py", line 325, in set_zone&lt;BR /&gt;update, running_config, return_type, False, mode=mode)&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/base.py", line 1522, in _set_reference&lt;BR /&gt;obj.update(reference_var)&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/base.py", line 621, in update&lt;BR /&gt;path, value, var_path = self._get_param_specific_info(variable)&lt;/P&gt;&lt;P&gt;File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/base.py", line 2455, in _get_param_specific_info&lt;BR /&gt;raise ValueError(msg.format(param, param_ref))&lt;/P&gt;&lt;P&gt;ValueError: While updating variable interface, missing replacement variable mode in path&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be most appreciated. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 20:08:36 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/pandevice-set-zone-error/m-p/333709#M2383</guid>
      <dc:creator>mrzepa2</dc:creator>
      <dc:date>2020-06-16T20:08:36Z</dc:date>
    </item>
  </channel>
</rss>

