Skip to content
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

show rep topology detail error #925

Closed
ajackson79 opened this issue Feb 5, 2025 · 5 comments
Closed

show rep topology detail error #925

ajackson79 opened this issue Feb 5, 2025 · 5 comments
Assignees

Comments

@ajackson79
Copy link

The 'show rep topology detail' parser fails when a device name includes a dash. (-)

Example of a device name that fails:

TEST-TEST

The error is:

python/site-packages/genie/libs/parser/iosxe/show_platform.py", line 9513, in cli
intf_dict['role'] = group['role']
UnboundLocalError: local variable 'intf_dict' referenced before assignment

@abvasudha
Copy link

Hi ajackson79,

Could you please share the raw output for 'show rep topology detail'.

Regards,
Vasudha

@ajackson79
Copy link
Author

ajackson79 commented Feb 5, 2025

This output fails with the error above.

REP Segment 170
BOI-AIR-AGG-1, Te0/0/26 (Primary Edge No-Neighbor)
Open Port, all vlans forwarding
Bridge MAC: 00ea.bd0a.243f
Port Number: 021
Port Priority: 000
Effective Port Priority: 00002100EABD0A243F
Neighbor Number: 1 / [-4]
BOI-AIR-AGG-1, Te0/0/27 (Intermediate)
Alternate Port, some vlans blocked
Bridge MAC: 00ea.bd0a.243f
Port Number: 022
Port Priority: 040
Effective Port Priority: 04002200EABD0A243F
Neighbor Number: 2 / [-3]
BOI-AIR-AGG-2, Te0/0/26 (Intermediate)
Open Port, all vlans forwarding
Bridge MAC: 00ea.bd0a.1dbf
Port Number: 021
Port Priority: 000
Effective Port Priority: 00002100EABD0A1DBF
Neighbor Number: 3 / [-2]
BOI-AIR-AGG-2, Te0/0/27 (Secondary Edge No-Neighbor)
Open Port, all vlans forwarding
Bridge MAC: 00ea.bd0a.1dbf
Port Number: 022
Port Priority: 000
Effective Port Priority: 00002200EABD0A1DBF
Neighbor Number: 4 / [-1]

I fixed my local version by changing the regex on line 9467 of the file show_platform.py

original:

p2 = re.compile(r'^(?P[\w\d]+), (?P[a-z|A-Z]+\d+/\d+(/\d+)?) ((?P.+))$')

my change:

p2 = re.compile(r'^(?P[\w\d-]+), (?P[a-z|A-Z]+\d+/\d+(/\d+)?) ((?P.+))$')

Now mine no longer errors. It would be nice to get the main branch edited though so updates don't break things on my side.

@sanjaydilli
Copy link

Hi @ajackson79 could please you mention which image the parser is failing IOSXE or IOSXR ?

@ajackson79
Copy link
Author

python/site-packages/genie/libs/parser/iosxe/show_platform.py", line 9513, in cli

iosxe

@sanjaydilli
Copy link

Hi @ajackson79, the above issue has been resolved and will take effect in the next release. Please continue contributing, and I will proceed with closing this ticket. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants