From 0a29dd1f35da0523708e7f0bed5cd3ceb28ee538 Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Sat, 24 Feb 2018 22:23:50 +0100 Subject: many backward-compatibility aids dropped --- pysnmp/smi/builder.py | 17 +---------------- pysnmp/smi/mibs/SNMPv2-SMI.py | 11 ----------- pysnmp/smi/rfc1902.py | 5 ++--- 3 files changed, 3 insertions(+), 30 deletions(-) (limited to 'pysnmp/smi') diff --git a/pysnmp/smi/builder.py b/pysnmp/smi/builder.py index 8b81b06c..e582b268 100644 --- a/pysnmp/smi/builder.py +++ b/pysnmp/smi/builder.py @@ -16,7 +16,7 @@ try: from errno import ENOENT except ImportError: ENOENT = -1 -from pysnmp import version as pysnmp_version +from pysnmp import __version__ as pysnmp_version from pysnmp.smi import error from pysnmp import debug @@ -290,21 +290,6 @@ class MibBuilder(object): def getMibSources(self): return tuple(self.__mibSources) - # Legacy/compatibility methods (won't work for .eggs) - def setMibPath(self, *mibPaths): - self.setMibSources(*[DirMibSource(x) for x in mibPaths]) - - def getMibPath(self): - paths = () - for mibSource in self.getMibSources(): - if isinstance(mibSource, DirMibSource): - paths += (mibSource.fullPath(),) - else: - raise error.MibLoadError( - 'MIB source is not a plain directory: %s' % (mibSource,) - ) - return paths - def loadModule(self, modName, **userCtx): for mibSource in self.__mibSources: debug.logger & debug.flagBld and debug.logger('loadModule: trying %s at %s' % (modName, mibSource)) diff --git a/pysnmp/smi/mibs/SNMPv2-SMI.py b/pysnmp/smi/mibs/SNMPv2-SMI.py index b6408930..abd64ddc 100644 --- a/pysnmp/smi/mibs/SNMPv2-SMI.py +++ b/pysnmp/smi/mibs/SNMPv2-SMI.py @@ -189,8 +189,6 @@ class NotificationType(MibNode): status = 'current' description = '' reference = '' - # retained for compatibility - revisions = () def getObjects(self): return self.objects @@ -223,15 +221,6 @@ class NotificationType(MibNode): self.reference = v return self - # This should not be here. Retained for compatibility. - - def getRevisions(self): - return self.revisions - - def setRevisions(self, v): - self.revisions = v - return self - def asn1Print(self): return """\ NOTIFICATION-TYPE diff --git a/pysnmp/smi/rfc1902.py b/pysnmp/smi/rfc1902.py index 07cea1e5..5eb756e6 100644 --- a/pysnmp/smi/rfc1902.py +++ b/pysnmp/smi/rfc1902.py @@ -893,9 +893,8 @@ class NotificationType(object): Instances of :py:class:`~pysnmp.smi.rfc1902.NotificationType` class are containers incorporating :py:class:`~pysnmp.smi.rfc1902.ObjectIdentity` class instance (identifying particular notification) and a collection - of MIB variables IDs that - :py:class:`~pysnmp.entity.rfc3413.oneliner.cmdgen.NotificationOriginator` - should gather and put into notification message. + of MIB variables IDs that *NotificationOriginator* should gather + and put into notification message. Typical notification is defined like this (from *IF-MIB.txt*): -- cgit v1.2.1