diff options
author | elie <elie> | 2015-04-27 20:01:32 +0000 |
---|---|---|
committer | elie <elie> | 2015-04-27 20:01:32 +0000 |
commit | 7dc7051d4e624f1e110d496426d2464a585e6745 (patch) | |
tree | 8b9bb44eb85961cd05d597901b3d3b2711e94873 | |
parent | fc9668bc7d3f4980b86b3aa3ecfe3b48d3c51722 (diff) | |
download | pysnmp-7dc7051d4e624f1e110d496426d2464a585e6745.tar.gz |
optional configuration/MIB directory added to MIB search path
(~/,pysnmp/mibs) at MibBuilder
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | pysnmp/smi/builder.py | 12 |
2 files changed, 13 insertions, 1 deletions
@@ -80,6 +80,8 @@ Revision 4.2.6rc2 - Parts of SMIv1 remnant MIBs (RFC1213-MIB, RFC1158-MIB) added to provide complete compatibility with SMIv1. Symbols defined in these MIBs only present in SMIv1 so they can't be substituted with their SMIv2 analogues. +- Optional configuration/MIB directory added to MIB search path + (~/,pysnmp/mibs) at MibBuilder. - Fix to authoritative engine side snmpEngineID discovery procedure: respond with notInTimeWindows rather then with unsupportedSecurityLevel at time synchronization phase. diff --git a/pysnmp/smi/builder.py b/pysnmp/smi/builder.py index b0f1dd3..610e89d 100644 --- a/pysnmp/smi/builder.py +++ b/pysnmp/smi/builder.py @@ -200,7 +200,17 @@ class MibBuilder: defaultCoreMibs = os.pathsep.join( ('pysnmp.smi.mibs.instances', 'pysnmp.smi.mibs') ) - defaultMiscMibs = 'pysnmp_mibs' + if sys.platform[:3] == 'win': + defaultMiscMibs = os.pathsep.join( + ( os.path.join(os.path.expanduser("~"), + 'PySNMP Configuration', 'mibs'), + 'pysnmp_mibs' ) + ) + else: + defaultMiscMibs = os.pathsep.join( + ( os.path.join(os.path.expanduser("~"), '.pysnmp', 'mibs'), + 'pysnmp_mibs' ) + ) moduleID = 'PYSNMP_MODULE_ID' def __init__(self): self.lastBuildId = self._autoName = 0 |