Open mofikus opened 1 year ago
Thanks for the report.
There are a few things you might check,
We are using the latest Python packages from our own, https://github.com/etingof/pysnmp/issues/429 So, you need mibdump
from pysmi-lextudio
1.1.13 and then the compiled .py for the MIB document can work with pysnmp-lextudio
5.0.25.
This repo does not support any other distribution of PySNMP bits as part of our support policies.
We cannot reproduce the issue with the MIB document from https://raw.githubusercontent.com/lextudio/mibs.pysnmp.com/master/asn1/CISCO-ENHANCED-IPSEC-FLOW-MIB
Due to our support policies, we didn't test the copy you provided, but feel free to let us know if the issue remains after you switch to our supported Python packages.
I am using the lextudio packages. I just tried to uninstall pysnmp and pysmi and get:
(venv) C:\testing\python_projects\testingMIBS>pip3 uninstall pysnmp
WARNING: Skipping pysnmp as it is not installed.
(venv) C:\testing\python_projects\testingMIBS>pip3 uninstall pysmi
WARNING: Skipping pysmi as it is not installed.
But uninstalling the lextudio packages works:
(venv) C:\testing\python_projects\testingMIBS>pip3 uninstall pysnmp-lextudio
Found existing installation: pysnmp-lextudio 5.0.25
Uninstalling pysnmp-lextudio-5.0.25:
Would remove:
C:\testing\python_projects\testingmibs\venv\lib\site-packages\pysnmp\*
C:\testing\python_projects\testingmibs\venv\lib\site-packages\pysnmp_lextudio-5.0.25.dist-info\*
Proceed (Y/n)? y
Successfully uninstalled pysnmp-lextudio-5.0.25
(venv) C:\testing\python_projects\testingMIBS>pip3 uninstall pysmi-lextudio
Found existing installation: pysmi-lextudio 1.1.13
Uninstalling pysmi-lextudio-1.1.13:
Would remove:
C:\testing\python_projects\testingmibs\venv\lib\site-packages\pysmi\*
C:\testing\python_projects\testingmibs\venv\lib\site-packages\pysmi_lextudio-1.1.13.dist-info\*
C:\testing\python_projects\testingmibs\venv\scripts\mibcopy.exe
C:\testing\python_projects\testingmibs\venv\scripts\mibdump.exe
Proceed (Y/n)? y
Successfully uninstalled pysmi-lextudio-1.1.13
I've now re-installed the packages and the issue still occurs.
If I add the following to the ObjectGroup class in pysnmp > smi > mibs > SNMPv2-CONF.py then I no longer face the issue:
def getReference(self):
return self.reference
def setReference(self, v):
self.reference = v
return self
I'm not sure if this is correct but it stops the issue. The same is true for the NotificationGroup class in that file also.
I've compiled a bunch of mibs, and have them stored in a folder. When running something like the following to get OIDs and descriptions from compiled MIBs, with the CISCO-ENHANCED-IPSEC-FLOW-MIB I get an error.
The code I'm running:
The exception I get:
I've attached a zip with the original MIB file and the compiled .py mib file.
Thanks
issue.zip