Skip to content

Commit abdf0d8

Browse files
authored
Merge branch 'main' into iss512
2 parents d6286e1 + ec4d683 commit abdf0d8

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
bugfixes:
3+
- fix facts gathering for ebgp-multihop attribute.

plugins/module_utils/network/eos/rm_templates/bgp_global.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
facilitates both facts gathering and native command generation for
1515
the given network resource.
1616
"""
17-
1817
import re
1918

2019
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.rm_base.network_template import (
@@ -264,7 +263,7 @@ def _tmplt_bgp_neighbor(config_data):
264263
elif config_data["neighbor"].get("dont_capability_negotiate"):
265264
command += " dont-capability-negotiate"
266265
elif config_data["neighbor"].get("ebgp_multihop"):
267-
command += " ebgp-multiphop"
266+
command += " ebgp-multihop"
268267
if config_data["neighbor"]["ebgp_multihop"].get("ttl"):
269268
command += " {ttl}".format(**config_data["neighbor"]["ebgp_multihop"])
270269
elif config_data["neighbor"].get("encryption_password"):
@@ -1654,7 +1653,7 @@ def __init__(self, lines=None, module=None):
16541653
\s*neighbor
16551654
\s+(?P<peer>\S+)
16561655
\s+ebgp-multihop
1657-
\s*(?P<ttl>\d+)*
1656+
\s+(?P<ttl>\d+)*
16581657
$""",
16591658
re.VERBOSE,
16601659
),

tests/unit/modules/network/eos/test_eos_bgp_global.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def test_eos_bgp_global_merged(self):
206206
"neighbor peer1 peer group",
207207
"neighbor peer1 bfd c-bit",
208208
"neighbor peer1 maximum-routes 12000",
209-
"neighbor peer1 ebgp-multiphop",
209+
"neighbor peer1 ebgp-multihop",
210210
"neighbor peer1 send-community link-bandwidth divide ratio",
211211
"neighbor peer1 timers 5 10",
212212
"neighbor peer1 ttl maximum-hops 33",
@@ -238,6 +238,31 @@ def test_eos_bgp_global_merged(self):
238238
]
239239
self.execute_module(changed=True, commands=commands)
240240

241+
def test_eos_bgp_global_merged_multihop(self):
242+
set_module_args(
243+
dict(
244+
config=dict(
245+
as_number="65535",
246+
router_id="192.168.1.1",
247+
neighbor=[
248+
dict(
249+
neighbor_address="10.2.2.1",
250+
peer_group="evpn",
251+
ebgp_multihop=dict(set=True, ttl=2),
252+
),
253+
],
254+
),
255+
state="merged",
256+
),
257+
)
258+
commands = [
259+
"router bgp 65535",
260+
"neighbor 10.2.2.1 ebgp-multihop 2",
261+
"neighbor 10.2.2.1 peer group",
262+
"router-id 192.168.1.1",
263+
]
264+
self.execute_module(changed=True, commands=commands)
265+
241266
def test_eos_bgp_global_replaced_idempotent(self):
242267
set_module_args(
243268
dict(
@@ -800,7 +825,7 @@ def test_eos_bgp_global_rendered(self):
800825
"neighbor peer2 peer group",
801826
"neighbor peer2 local-as 55 no-prepend replace-as fallback",
802827
"neighbor peer2 next-hop-v6-addr 5001::/64 in",
803-
"neighbor peer2 ebgp-multiphop 10",
828+
"neighbor peer2 ebgp-multihop 10",
804829
"neighbor peer2 enforce-first-as",
805830
"neighbor peer2 fall-over bfd",
806831
"neighbor peer2 graceful-restart-helper",

0 commit comments

Comments
 (0)