-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NX-OS show interface status parser overflows in some cases #736
Comments
Hi . |
Hello, |
Hi blue212121, p1 = re.compile(r'(?P(\S+))\s+(?P(\S+))?\s' p1_1 = re.compile(r'(?P(\S+))\s+' |
Hi blue212121, |
Hi sumit, havent got time to test the above solution yet, but looks similar to the original p1_1 which produced the issue, but will check eventually, thank you for your patience |
Hi @sumitsehgal123 , sorry, accidentally closed issue, but it is still not fixed, proposed solution is syntactically incorrect as it is missing the names from the named groups:
but even when filling in from source code, the result still produces the same wrong groupdict from the original post from this issue, where description and status merge together. problem regex:
so unfortunely this issue still exists |
Hi blue212121, |
Hi Blue212121, dev.parse("show interface status", output=output) |
After make changes in the source file , you have to give make develop and make json in the genieparser directory. After that please try to execute the parser.it will give the excepted output . |
apparently this issue is reproducible when using the nxos parser, when there is a space in the description, see below on Ethernet1/3:
teststring:
|
Hi Blue212121, |
Hello @sumitsehgal123, that is strange indeed... with provided teststring, the resulting json is correct for you without the description regex group overflowing into the status? here is my pip freeze (only installed pyats[full] inside venv):
|
Hi blue212121, pyats shell --testbed-file testbed.yaml output: Since I'm unable to reproduce the issue, can you please try again. The pyats version used is 23.3 and python version 3.8. |
Hello @sumitsehgal123,
|
Hi Blue , output= Eth1/4 testdesc is 2 connected 1 full 1000 1000base-T Pattern : |
Hello @sumitsehgal123 it is matching, but the parsing itself is incorrect as shown previously... hence why issue is created... |
Hi , Please let me know if you need any help during the process of PR creation. If not let me know we will add this to our backlog and let you know once it is fixed |
Hello @sumitsehgal123 |
Hi |
Hello @sumitsehgal123 , thank you, looking forward to switching back to main :) |
Hi ,
if you need any further assistance .please let me know . |
Issue is with p1_1 for me, example input, and result:
input:
result:
'connected' state is working i suppose because the port speed is num in that case, hence not matchin [a-z] in duplex_code
Working regex for me by defining the possible vlan values, so that the
<name>
wont overflow and match the<status>
variable as well (since<type>
can match whitespace only as well, it will match even a single space at the end after the actual type is what im guessing):but may be better regex solution (not sure if there are other values for vlan field) thats why i opened an issue and not a pull request
hardware: N3K-C3064PQ-10GE
software: NXOS: version 7.0(3)I7(9)
genie==23.2
pyats==23.2
The text was updated successfully, but these errors were encountered: