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

JSON output fails if a descriptor is a Python keyword #58

Open
lemon1866 opened this issue Apr 1, 2020 · 3 comments
Open

JSON output fails if a descriptor is a Python keyword #58

lemon1866 opened this issue Apr 1, 2020 · 3 comments

Comments

@lemon1866
Copy link

I'm getting an error when parsing a certain MIB:

mibdump.py --destination-format=json HUAWEI-MIB
Source MIB repositories: file:///usr/share/snmp/mibs, http://mibs.snmplabs.com/asn1/@mib@
Borrow missing/failed MIBs from: http://mibs.snmplabs.com/json/notexts/@mib@
Existing/compiled MIB locations: 
Compiled MIBs destination directory: .
MIBs excluded from code generation: RFC-1212, RFC-1215, RFC1065-SMI, RFC1155-SMI, RFC1158-MIB, RFC1213-MIB, SNMPv2-CONF, SNMPv2-SMI, SNMPv2-TC, SNMPv2-TM
MIBs to compile: HUAWEI-MIB
Destination format: json
Parser grammar cache directory: not used
Also compile all relevant MIBs: yes
Rebuild MIBs regardless of age: no
Dry run mode: no
Create/update MIBs: yes
Byte-compile Python modules: no (optimization level no)
Ignore compilation errors: no
Generate OID->MIB index: no
Generate texts in MIBs: no
Keep original texts layout: no
Try various file names while searching for MIB module: yes
Created/updated MIBs: 
Pre-compiled MIBs borrowed: 
Up to date MIBs: SNMPv2-CONF, SNMPv2-SMI, SNMPv2-TC
Missing source MIBs: 
Ignored MIBs: 
Failed MIBs: HUAWEI-MIB (No generated code for symbol pysmi_as at MIB HUAWEI-MIB)

It looks like this is caused by 1.3.6.1.4.1.2011.2.36 with descriptor 'as,' which is a python keyword.

@oortega
Copy link

oortega commented Apr 24, 2020

did you solve the issue? in my case works with http://mibs.snmplabs.com source

@lemon1866
Copy link
Author

did you solve the issue? in my case works with http://mibs.snmplabs.com source

Would you mind sharing your command/output? I'm guessing the bug won't occur if you're pulling the pre-compiled MIB from somewhere.

@lextm
Copy link

lextm commented Mar 3, 2024

This is fixed in #68 and has been now available from many pysmi forks.

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