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

fix: layer2 interface creation #496

Closed jamesholland-uk closed 1 year ago

jamesholland-uk commented 1 year ago

Description

In PAN-OS, layer 2 interfaces do not get added to virtual routers. This fix stops the SDK trying to add layer 2 interfaces to virtual routers when the interface is created.

Motivation and Context

Fix for https://github.com/PaloAltoNetworks/pan-os-ansible/issues/173

How Has This Been Tested?

Tested locally via Ansible

Before:

TASK [Create interfaces] ***********************************************************************************************************************************************************************************************************************
failed: [host_labfw] (item={'name': 'ethernet1/8', 'mode': 'layer2', 'vlan_name': 'Management', 'lldp_enabled': False, 'zone_name': 'VLANs'}) => {"ansible_loop_var": "item", "changed": false, "item": {"lldp_enabled": false, "mode": "layer2", "name": "ethernet1/8", "vlan_name": "Management", "zone_name": "VLANs"}, "msg": "Failed set_virtual_router:  interface 'ethernet1/8' is not a valid reference"}

After:

TASK [Create interfaces] ***********************************************************************************************************************************************************************************************************************
changed: [host_labfw] => (item={'name': 'ethernet1/8', 'mode': 'layer2', 'vlan_name': 'Management', 'lldp_enabled': False, 'zone_name': 'VLANs'})

Types of changes

Checklist

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.8.1 :tada:

The release is available on PyPI and GitHub release

Posted by semantic-release bot