Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(network.StaticRoute): conditions and none value nexthop_type #578

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

alperenkose
Copy link
Collaborator

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.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

Add conditions to StaticRoute nexthop and nexthop_type params
as well as accepting 'none' value as an input for nexthop_type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant