Skip to content

Commit

Permalink
Fix issue in afi choices (#473)
Browse files Browse the repository at this point in the history
* Fix issue in afi choices

* Fix uts

---------

Co-authored-by: Ashwini Mhatre <amhatre@amhatre-thinkpadt14sgen2i.pnq.csb>
  • Loading branch information
ashwini-mhatre and Ashwini Mhatre authored Feb 22, 2024
1 parent 478c93d commit 8d7c66a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion changelogs/fragments/bugfix_bgp_templates.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
bugfixes:
minor_changes:
- Add missing options in afi and safi in address-family of bgp_templates RM.
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_bgp_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- Fix 'afi' value in bgp_templates RM to valid values.
4 changes: 2 additions & 2 deletions docs/cisco.iosxr.iosxr_bgp_templates_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ Parameters
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>ipv4</li>
<li>ipv6</li>
<li>vpn4</li>
<li>vpn6</li>
<li>vpnv4</li>
<li>vpnv6</li>
<li>link-state</li>
<li>l2vpn</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class Bgp_templatesArgs(object): # pylint: disable=R0903
"choices": [
"ipv4",
"ipv6",
"vpn4",
"vpn6",
"vpnv4",
"vpnv6",
"link-state",
"l2vpn",
],
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/iosxr_bgp_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
afi:
description: address family.
type: str
choices: [ 'ipv4', 'ipv6', 'vpn4', 'vpn6', 'link-state', 'l2vpn']
choices: [ 'ipv4', 'ipv6', 'vpnv4', 'vpnv6', 'link-state', 'l2vpn']
safi:
description: Address Family modifier
type: str
Expand Down
16 changes: 8 additions & 8 deletions tests/unit/modules/network/iosxr/test_iosxr_bgp_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ def test_iosxr_bgp_tmpl_merged(self):
advertise=dict(local_labeled_route=dict(set=True)),
),
dict(
afi="vpn4",
afi="vpnv4",
safi="unicast",
),
dict(
afi="vpn6",
afi="vpnv6",
safi="unicast",
),
dict(
Expand Down Expand Up @@ -340,8 +340,8 @@ def test_iosxr_bgp_tmpl_merged(self):
"bfd fast-detect strict-mode",
"internal-vpn-client",
"precedence critical",
"address-family vpn4 unicast",
"address-family vpn6 unicast",
"address-family vpnv4 unicast",
"address-family vpnv6 unicast",
"address-family link-state link-state",
"address-family l2vpn evpn",
"address-family ipv4 unicast",
Expand Down Expand Up @@ -1148,9 +1148,9 @@ def test_iosxr_bgp_tmpl_gathered(self):
precedence critical
advertisement-interval 10
internal-vpn-client
address-family vpn4 unicast
address-family vpnv4 unicast
!
address-family vpn6 unicast
address-family vpnv6 unicast
!
address-family link-state link-state
!
Expand Down Expand Up @@ -1227,8 +1227,8 @@ def test_iosxr_bgp_tmpl_gathered(self):
"advertisement_interval": 10,
"internal_vpn_client": True,
"address_family": [
{"afi": "vpn4", "safi": "unicast"},
{"afi": "vpn6", "safi": "unicast"},
{"afi": "vpnv4", "safi": "unicast"},
{"afi": "vpnv6", "safi": "unicast"},
{"afi": "link-state", "safi": "link-state"},
{"afi": "l2vpn", "safi": "evpn"},
{
Expand Down

0 comments on commit 8d7c66a

Please sign in to comment.