pan-os-python
pan-os-python copied to clipboard
feat(network.StaticRoute): conditions and none value nexthop_type
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 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.
- [x] All new and existing tests passed.