Skip to content

Commit

Permalink
fix parsing of password_options while gathering password configuratio…
Browse files Browse the repository at this point in the history
…n from appliance
  • Loading branch information
KB-perByte committed Oct 6, 2024
1 parent 07f70a7 commit 30c29bd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/bgp_global_render_pass.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- ios_bgp_global - fix parsing of password_options while gathering password configuration from appliance.
- ios_bgp_address_family - fix parsing of password_options while gathering password configuration from appliance.
Original file line number Diff line number Diff line change
Expand Up @@ -1586,8 +1586,8 @@ def __init__(self, lines=None, module=None):
"getval": re.compile(
r"""
\s\sneighbor\s(?P<neighbor_address>\S+)\spassword
\s(?P<encryption>\d+)
(\s(?P<pass_key>.$))?
(\s(?P<encryption>\d+))
(\s(?P<pass_key>.+))?
$""",
re.VERBOSE,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ def __init__(self, lines=None, module=None):
r"""
\sneighbor\s(?P<neighbor_address>\S+)\spassword
\s(?P<encryption>\d+)
(\s(?P<pass_key>.$))?
(\s(?P<pass_key>.+))?
$""",
re.VERBOSE,
),
Expand Down
9 changes: 8 additions & 1 deletion tests/unit/modules/network/ios/test_ios_bgp_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ def test_ios_bgp_global_parsed(self):
timers bgp 100 200 150
redistribute connected metric 10
neighbor 192.0.2.1 remote-as 100
neighbor 192.0.2.1 password 7 DEQPITOP101395
neighbor 192.0.2.1 route-map test-route out
address-family ipv4
neighbor 192.0.2.28 activate
Expand All @@ -652,7 +653,13 @@ def test_ios_bgp_global_parsed(self):
{
"remote_as": "100",
"neighbor_address": "192.0.2.1",
"route_maps": [{"name": "test-route", "out": True}],
"route_maps": [
{"name": "test-route", "out": True},
],
"password_options": {
"encryption": 7,
"pass_key": "DEQPITOP101395",
},
},
],
}
Expand Down

0 comments on commit 30c29bd

Please sign in to comment.