pandevice set_zone error

Showing results for 
Show  only  | Search instead for 
Did you mean: 

pandevice set_zone error

L2 Linker



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. 

<previous code removed>

#Create a network interface object named tunnl.[TunnelID]
tun = network.TunnelInterface(TunnelID,ip=DATACENTER_TUN_INTF,comment=TUN_COMMENT)
#Add the tunnel object to the Template object and create it.



#everything is good up until this point


The error I get when I run the code:

Traceback (most recent call last):

File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/", line 2447, in _get_param_specific_info
p = token.format(**{})

KeyError: 'mode'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/Users/mrzepa/src/", line 313, in <module>

File "/Users/mrzepa/src/", line 280, in main

File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/", line 325, in set_zone
update, running_config, return_type, False, mode=mode)

File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/", line 1522, in _set_reference

File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/", line 621, in update
path, value, var_path = self._get_param_specific_info(variable)

File "/Users/mrzepa/opt/anaconda3/lib/python3.7/site-packages/pandevice/", line 2455, in _get_param_specific_info
raise ValueError(msg.format(param, param_ref))

ValueError: While updating variable interface, missing replacement variable mode in path


Any help would be most appreciated. Thanks.

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!