summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--pysnmp/smi/builder.py12
2 files changed, 13 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 4d96f03..f2a85a7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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