Skip to content

Commit

Permalink
Merge pull request #1 from posntw/patch-1
Browse files Browse the repository at this point in the history
Updated regex pattern and related test
  • Loading branch information
posntw authored Aug 2, 2023
2 parents 58d4b46 + 5b7f573 commit aa9af26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mb_netmgmt/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_cli_patterns():
b"[\r\n\x00\x1b\[K]RP/\d+/(?:RS?P)?\d+\/CPU\d+:[^#]+(?:\([^\)]+\))?#$"
) # based on IOS XR driver of Exscript
patterns.append(
b"[\r\n\x00\x1b\[K](?P<text>[\w/ .:,\(\)\-\?]*)(?P<default>\[[\w/.,():\-]*\])?(?(default)(?P<end1>(?:\?|: ?| |)$)|(?P<end2>: $))"
b"[\r\n\x00\x1b\[K](?P<text>[\w/ .:,>\(\)\-\?]*)(?P<default>\[[\w/.,():\-]*\])?(?(default)(?P<end1>(?:\?|: ?| |)$)|(?P<end2>: $))"
) # Interactive prompt
patterns.append(b"[\r\n\x00\x1b\[K] --More-- $") # Terminal paging
return patterns
Expand Down
1 change: 1 addition & 0 deletions test/test_mb_netmgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
(b"\rDo you wish to continue?[confirm(y/n)]", True),
(b"\r --More-- ", True),
(b"\rSending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:", False),
(b"\rProceed with switchover 0/8/CPU0 -> 0/7/CPU0? [confirm]", True),
]


Expand Down

0 comments on commit aa9af26

Please sign in to comment.