summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2013-06-04 06:06:23 +0000
committerelie <elie>2013-06-04 06:06:23 +0000
commitb7c4ef6e38d81a9a6afb92eda07fa4c480b77fbf (patch)
tree3884180e62c62e714645e335a2b9e05d321070a9
parent5df996f4cfac0135817adef1c394bdc9b154b8fa (diff)
downloadpysnmp-git-b7c4ef6e38d81a9a6afb92eda07fa4c480b77fbf.tar.gz
traceback formatting improved
-rw-r--r--CHANGES.txt1
-rw-r--r--pysnmp/smi/builder.py12
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 905211b3..90357cb9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -60,6 +60,7 @@ Revision 4.2.5rc2
This improves LCD consistency on sparse add/del operatons but also
does not let you to configure different securityModels per securityname
at VACM though the cfgCmdGen() wrapper.
+- MIB builder traceback formatting and reporting improved.
- Fix and significant logic rework of snmpCommunityTable to make it working
in both Generator and Responder modes and better follow RFC2576
requirements on sequential entries lookup and selection. As a side effect,
diff --git a/pysnmp/smi/builder.py b/pysnmp/smi/builder.py
index 84588662..214d7232 100644
--- a/pysnmp/smi/builder.py
+++ b/pysnmp/smi/builder.py
@@ -1,5 +1,5 @@
# MIB modules loader
-import os, sys, imp, struct, marshal, time
+import os, sys, imp, struct, marshal, time, traceback
from pysnmp.smi import error
from pysnmp import debug
@@ -90,7 +90,13 @@ class __AbstractMibSource:
return self._getData(f+pySfx, pyMode), pySfx
raise IOError('No suitable module found')
-
+
+ # Interfaces for subclasses
+ def _init(self): raise NotImplementedError()
+ def _listdir(self): raise NotImplementedError()
+ def _getTimestamp(self, f): raise NotImplementedError()
+ def _getData(self, f, mode=None): NotImplementedError()
+
class ZipMibSource(__AbstractMibSource):
def _init(self):
try:
@@ -250,7 +256,7 @@ class MibBuilder:
except Exception:
del self.__modPathsSeen[modPath]
raise error.SmiError(
- 'MIB module \"%s\" load error: %s' % (modPath, sys.exc_info()[1])
+ 'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
)
self.__modSeen[modName] = modPath