pan-os-python icon indicating copy to clipboard operation
pan-os-python copied to clipboard

BgpPolicyRule community_action_argument doesn't allow all valid input

Open steve-krause opened this issue 5 years ago • 1 comments

If you try to apply a non-default setting using the action_community_argument parameter in the BgpPolicyRule class you receive an error when you try to apply the change to a device

Describe the bug

If you try to apply a non-default setting using the action_community_argument parameter in the BgpPolicyRule class you receive an error when you try to apply the change to a device

Expected behavior

This parameter should allow all valid strings according to the documentation

Current behavior

An error is thrown

Possible solution

add a vartype='member' to the 'action_community_argument' VersionedParamPath within the BgpPolicyRule class in network.py

Steps to reproduce

  1. Create a BgpImportPolicyRule with action_community='append' and action_community_argument=65000:1
  2. Apply the change to an existing template

Screenshots

Context

Your Environment

I am attempting to make this change using Panorama version 8.1

  • Version used: 0.14.0
  • Environment name and version: python 3.8
  • Operating System and version: Ubuntu 20.04
  • Link to your project:

steve-krause avatar Jun 16 '20 18:06 steve-krause

Thank for the tips, added vartype="member" on line 3587 and 3612. Test works. Hope this will added in the next merge . network: py

3578         params.append(
3579             VersionedParamPath(
3580                 "action_community_argument",
3581                 default=None,
3582                 condition={
3583                     "action": "allow",
3584                     "action_community_type": ["remove-regex", "append", "overwrite"],
3585                 },
3586                 path="action/{action}/update/community/{action_community_type}",
3587                 vartype="member",
3588             )
3589         )
...
3599         params.append(
3600             VersionedParamPath(
3601                 "action_extended_community_argument",
3602                 default=None,
3603                 condition={
3604                     "action": "allow",
3605                     "action_extended_community_type": [
3606                         "remove-regex",
3607                         "append",
3608                         "overwrite",
3609                     ],
3610                 },
3611                 path="action/{action}/update/extended-community/{action_extended_community_type}",
3612                 vartype="member",
3613             )

nguyh avatar Nov 06 '21 01:11 nguyh