You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
Prompt pattern brn\-boll111\-.*?(\(.*?\))?[\>|\#] matches in show interfaces description on an interface that has brn-boll111-ap-02 Gi0 <LS:LIR> in its description.
General Information
OS:
RHEL7, python3.6
Netdev version:
asyncssh==1.18.0
netdev==0.9.3
Device OS:
Cisco IOS XE Software, Version 16.12.03s
C9300
Debug information
[2020-12-10 10:30:09,152 DEBUG base.py:388 - _read_until_prompt_or_pattern() pn:MainProcess pid:31799 t:MainThread ] Host <SNIP>: Reading pattern 'brn\-boll111\-.*?(\(.*?\))?[\>|\#]' or 'brn\-boll111\-.*?(\(.*?\))?[\>|\#]' was found: 'show interfaces description\r\nInterface Status Protocol Description\r\nVl1 up up not used <LS:C>\r\n<SNIP> <LS:CV>\r\nTe3/0/20 down down Access-Port with 802.1x - lan <LS:CV>\r\nTe3/0/21 down down Access-Port with 802.1x - lan <LS:CV>\r\nTe3/0/22 down down Access-Port with 802.1x - lan <LS:CV>\r\nTe3/0/23 up up Fabric Physical Link - brn-boll111-ap-02 Gi0 <LS:LIR>\r\nTe3/0/24 up up Fabric Physical Link - brn-boll111-ap-02 Gi0 <LS:LIR>\r\nGi3/1/1 admin down down not used <LS:C>\r\nGi3/1/2 admin down down not used <LS:C>\r\nGi3/1/3 admin down down not used <LS:C>\r\nGi3/1/4 admin down down not used <LS:C>\r\nTe3'
Additional context
Any ideas for a quick fix until the problem can be solved permanently?
The text was updated successfully, but these errors were encountered:
I think I found the issue. In the code only the first 12 characters from the base prompt are being used for the pattern. Our hostname has 18 characters. I fixed the issue as follows.
netdev/vendors/base.py - line 172: _pattern = r"{prompt}.*?(\(.*?\))?[{delimiters}]"
changed to
_pattern = r"{prompt}(\(.*?\))?[{delimiters}]"
AND
netdev/vendors/base.py - line 252: base_prompt = re.escape(self._base_prompt[:12])
changed to
base_prompt = re.escape(self._base_prompt)
Now it works without problems.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Prompt pattern
brn\-boll111\-.*?(\(.*?\))?[\>|\#]
matches inshow interfaces description
on an interface that hasbrn-boll111-ap-02 Gi0 <LS:LIR>
in its description.General Information
OS:
RHEL7, python3.6
Netdev version:
asyncssh==1.18.0
netdev==0.9.3
Device OS:
Cisco IOS XE Software, Version 16.12.03s
C9300
Debug information
[2020-12-10 10:30:09,152 DEBUG base.py:388 - _read_until_prompt_or_pattern() pn:MainProcess pid:31799 t:MainThread ] Host <SNIP>: Reading pattern 'brn\-boll111\-.*?(\(.*?\))?[\>|\#]' or 'brn\-boll111\-.*?(\(.*?\))?[\>|\#]' was found: 'show interfaces description\r\nInterface Status Protocol Description\r\nVl1 up up not used <LS:C>\r\n<SNIP> <LS:CV>\r\nTe3/0/20 down down Access-Port with 802.1x - lan <LS:CV>\r\nTe3/0/21 down down Access-Port with 802.1x - lan <LS:CV>\r\nTe3/0/22 down down Access-Port with 802.1x - lan <LS:CV>\r\nTe3/0/23 up up Fabric Physical Link - brn-boll111-ap-02 Gi0 <LS:LIR>\r\nTe3/0/24 up up Fabric Physical Link - brn-boll111-ap-02 Gi0 <LS:LIR>\r\nGi3/1/1 admin down down not used <LS:C>\r\nGi3/1/2 admin down down not used <LS:C>\r\nGi3/1/3 admin down down not used <LS:C>\r\nGi3/1/4 admin down down not used <LS:C>\r\nTe3'
Additional context
Any ideas for a quick fix until the problem can be solved permanently?
The text was updated successfully, but these errors were encountered: