Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruchip16 committed Dec 26, 2024
1 parent e5b5c89 commit f894b7f
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 286 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,6 @@ class Vrf_address_familyArgs(object): # pylint: disable=R0903
},
},
},
"maximum": {
"type": "dict",
"options": {
"routes": {
"type": "dict",
"options": {
"limit": {"type": "int"},
"threshold": {"type": "int"},
"reinstall": {
"type": "dict",
"options": {
"threshold_val": {"type": "int"}
},
},
"warning_only": {"type": "bool"},
},
}
},
},
"inter_as_hybrid": {
"type": "dict",
"options": {
Expand Down Expand Up @@ -1143,59 +1124,10 @@ class Vrf_address_familyArgs(object): # pylint: disable=R0903
},
},
},
"route_replicate_distance": {
"type": "dict",
"options": {
"from_config": {
"type": "dict",
"options": {
"multicast": {
"type": "dict",
"options": {
"distance": {"type": "int"},
"topology": {
"type": "dict",
"options": {
"base": {
"type": "dict",
"options": {
"distance": {
"type": "int"
}
},
}
},
},
},
},
"unicast": {
"type": "dict",
"options": {
"distance": {"type": "int"},
"topology": {
"type": "dict",
"options": {
"base": {
"type": "dict",
"options": {
"distance": {
"type": "int"
}
},
}
},
},
},
},
},
}
},
},
"route_target": {
"type": "dict",
"options": {
"export": {"type": "str"},
"stitching": {"type": "bool"},
"import_config": {"type": "str"},
"both": {"type": "str"},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ def __init__(self, module):
"route_replicate.from.vrf.vrf_name.unicast.static.route_map",
"route_target.export",
"route_target.import_config",
"route_target.import_config.stitching",
"route_target.export.stitching"

]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def __init__(self, lines=None, module=None):
\s+export\sipv4\sunicast\s(?P<prefix>\d+)\smap\s(?P<export_map>\S+)\s(?P<allow_evpn>allow-evpn)
$""", re.VERBOSE,
),
"setval": "export ipv4 unicast {{ export.ipv4.unicast.prefix }} map {{ export.ipv4.unicast.map }} allow-evpn",
"setval": "export ipv4 unicast {{ prefix }} map {{ export_map }} allow-evpn",
"result": {
'{{ name }}': {
'name': '{{ name }}',
Expand Down Expand Up @@ -184,7 +184,7 @@ def __init__(self, lines=None, module=None):
\s+import\sipv4\smulticast\s(?P<prefix>\d+)\smap\s(?P<import_map>\S+)
$""", re.VERBOSE,
),
"setval": "import ipv4 multicast {{ import.ipv4.multicast.prefix }} map {{ import.ipv4.multicast.map }}",
"setval": "import ipv4 multicast {{ prefix }} map {{ import_map }}",
"result": {
'{{ name }}': {
'name': '{{ name }}',
Expand Down Expand Up @@ -216,7 +216,7 @@ def __init__(self, lines=None, module=None):
\s+import\sipv4\sunicast\s(?P<limit>\d+)\smap\s(?P<import_map>\S+)\s(?P<allow_evpn>allow-evpn)
$""", re.VERBOSE,
),
"setval": "import ipv4 unicast {{ import.ipv4.unicast.limit }} map {{ import.ipv4.unicast.map }} allow-evpn",
"setval": "import ipv4 unicast {{ limit }} map {{ import_map }} allow-evpn",
"result": {
'{{ name }}': {
'name': '{{ name }}',
Expand Down Expand Up @@ -1087,7 +1087,7 @@ def __init__(self, lines=None, module=None):
\s+route-replicate\sfrom\svrf\s(?P<vrf_name>\S+)\sunicast\sall\sroute-map\s(?P<route_map>\S+)
$""", re.VERBOSE,
),
"setval": "route-replicate from vrf {{ route_replicate.from.vrf.vrf_name }} unicast all route-map {{ route_replicate.from.vrf.vrf_name.unicast.all.route_map }}",
"setval": "route-replicate from vrf {{ vrf_name }} unicast all route-map {{ route_map }}",
"result": {
'{{ name }}': {
'name': '{{ name }}',
Expand Down Expand Up @@ -1801,34 +1801,6 @@ def __init__(self, lines=None, module=None):
},
},
},
{
"name": "route_target.export.stitching",
"getval": re.compile(
r"""
^vrf\sdefinition\s(?P<name>\S+)
\saddress-family
\s(?P<afi>\S+)
(\s(?P<safi>\S+))?
\s+route-target\sexport\s(?P<route_target_export>\S+)\sstitching
$""", re.VERBOSE,
),
"setval": "route-target export {{ route_target.export }} stitching",
"result": {
'{{ name }}': {
'name': '{{ name }}',
"address_families": {
'{{ "address_families_" + afi + ("_" + safi if safi is defined else "_unicast") }}': {
"afi": "{{ afi }}",
"safi": "{{ safi if safi is defined else 'unicast' }}",
"route_target": {
"export": "{{ route_target_export }}",
"stitching": "{{ true }}",
},
},
},
},
},
},
{
"name": "route_target.import_config",
"getval": re.compile(
Expand Down Expand Up @@ -1856,33 +1828,5 @@ def __init__(self, lines=None, module=None):
},
},
},
{
"name": "route_target.import_config.stitching",
"getval": re.compile(
r"""
^vrf\sdefinition\s(?P<name>\S+)
\saddress-family
\s(?P<afi>\S+)
(\s(?P<safi>\S+))?
\s+route-target\simport\s(?P<route_target_import_config>\S+)\sstitching
$""", re.VERBOSE,
),
"setval": "route-target import {{ route_target.import_config }} stitching",
"result": {
'{{ name }}': {
'name': '{{ name }}',
"address_families": {
'{{ "address_families_" + afi + ("_" + safi if safi is defined else "_unicast") }}': {
"afi": "{{ afi }}",
"safi": "{{ safi if safi is defined else 'unicast' }}",
"route_target": {
"import_config": "{{ route_target_import_config }}",
"stitching": "{{ true }}",
},
},
},
},
},
},
]
# fmt: on
61 changes: 0 additions & 61 deletions plugins/modules/ios_vrf_address_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,6 @@
allow_evpn:
description: allow Global->VRF routes into EVPN
type: bool
maximum: &maximum
description: Set a limit to a routing table
type: dict
suboptions:
routes:
description: Maximum number of routes allowed in the routing table
type: dict
suboptions:
limit:
description: Maximum number of routes allowed
type: int
threshold:
description: Threshold value (%) at which to generate a warning msg
type: int
reinstall:
description: Reinstall previous rejected route due to over maximum route limit
type: dict
suboptions:
threshold_val:
description: Threshold value (%) at which to reinstall routes back to VRF
type: int
warning_only:
description: Only give a warning message if limit is exceeded
type: bool
inter_as_hybrid: &inter_as_hybrid
description: Inter AS hybrid mode
type: dict
Expand Down Expand Up @@ -480,50 +456,13 @@
ospf: *ospf
rip: *rip
static: *static
route_replicate_distance: &route_replicate_distance
description: Route replicate distance
type: dict
suboptions:
from_config:
description: Route replicate distance from another VRF
type: dict
suboptions:
multicast:
description: Multicast SAFI
type: dict
suboptions:
distance:
description: Route replicate distance range
type: int
topology: &id001
description: Specify a Routing Topology
type: dict
suboptions:
base:
description: Base routing topology
type: dict
suboptions:
distance:
description: Route replicate distance range
type: int
unicast:
description: Unicast SAFI
type: dict
suboptions:
distance:
description: Route replicate distance range
type: int
topology: *id001
route_target: &route_target
description: Specify Target VPN Extended Communities.
type: dict
suboptions:
export:
description: Export Target-VPN community.
type: str
stitching:
description: VXLAN route target set.
type: bool
import_config:
description: Export Target-VPN community.
type: str
Expand Down
Loading

0 comments on commit f894b7f

Please sign in to comment.