summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt2
-rw-r--r--pysnmp/smi/builder.py8
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index c90cc09b..0c44b56c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,8 @@
Revision 4.4.2, released 2017-11-XX
-----------------------------------
+- The pysnmp version being used gets exposed to the MIB modules
+ via the `MibBuilder` instance
- The .setObjects() method of the SMI types now accepts
`append=False` parameter to let the caller adding more
than 255 elements over the course of multiple calls
diff --git a/pysnmp/smi/builder.py b/pysnmp/smi/builder.py
index b597787c..af890308 100644
--- a/pysnmp/smi/builder.py
+++ b/pysnmp/smi/builder.py
@@ -16,6 +16,7 @@ try:
from errno import ENOENT
except ImportError:
ENOENT = -1
+from pysnmp import __version__ as pysnmp_version
from pysnmp.smi import error
from pysnmp import debug
@@ -235,13 +236,18 @@ class DirMibSource(__AbstractMibSource):
class MibBuilder(object):
- loadTexts = 0
defaultCoreMibs = os.pathsep.join(
('pysnmp.smi.mibs.instances', 'pysnmp.smi.mibs')
)
defaultMiscMibs = 'pysnmp_mibs'
+
moduleID = 'PYSNMP_MODULE_ID'
+ loadTexts = False
+
+ # MIB modules can use this to select the features they can use
+ version = pysnmp_version
+
def __init__(self):
self.lastBuildId = self._autoName = 0
sources = []