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.
Add conditions to StaticRoute nexthop and nexthop_type params as well as accepting 'none' value as an input for nexthop_type.
Motivation and Context
Providing None vs a 'none' string to nexthop_type param in pan-os-ansible panos_static_route module cause different behaviour. Providing None (meaning no value is provided) means to use the default value of the object on present/merged states whereas providing a 'none' value means to set the nexthop_type to "None" in panos.
This is causing an issue with a recent change in pan-os-ansible where it fetches default values from pan-os-python sdk while creating or updating objects with None value params. With this change pan-os-python can also accept "none" str value for nexthop_type as well as structure the xml depending on the nexthop_type via conditions.
This is NOT a breaking change since it's still possible to use StaticRoute class with nexthop_type and nexthop set to None in order to produce "None" next hop type in panos xml.
How Has This Been Tested?
Tested live on VMSeries firewalls as well as with the written integration tests.
Types of changes
New feature (non-breaking change which adds functionality)
Checklist
[ ] I have updated the documentation accordingly.
[ ] I have read the CONTRIBUTING document.
[x] I have added tests to cover my changes if appropriate.
Description
Add conditions to
StaticRoute
nexthop and nexthop_type params as well as accepting 'none' value as an input for nexthop_type.Motivation and Context
Providing
None
vs a'none'
string tonexthop_type
param inpan-os-ansible
panos_static_route module cause different behaviour. ProvidingNone
(meaning no value is provided) means to use the default value of the object on present/merged states whereas providing a'none'
value means to set the nexthop_type to "None" in panos.This is causing an issue with a recent change in pan-os-ansible where it fetches default values from pan-os-python sdk while creating or updating objects with None value params. With this change pan-os-python can also accept "none" str value for nexthop_type as well as structure the xml depending on the nexthop_type via conditions.
This is NOT a breaking change since it's still possible to use
StaticRoute
class withnexthop_type
andnexthop
set toNone
in order to produce "None" next hop type in panos xml.How Has This Been Tested?
Tested live on VMSeries firewalls as well as with the written integration tests.
Types of changes
Checklist