From fc5ce6cda67e7143330fd34b10025c5465e10965 Mon Sep 17 00:00:00 2001 From: Lex Li Date: Sun, 13 Oct 2024 20:15:12 -0400 Subject: [PATCH] Added missing test cases. --- .../source/faq/how-to-implement-agent-mib.rst | 2 +- pyproject.toml | 10 ++++----- pysnmp/smi/builder.py | 6 +++--- pysnmp/smi/indices.py | 21 +++++++++++++++++++ pysnmp/smi/mibs/ASN1-ENUMERATION.py | 2 +- pysnmp/smi/mibs/ASN1-REFINEMENT.py | 2 +- pysnmp/smi/mibs/ASN1.py | 2 +- pysnmp/smi/mibs/INET-ADDRESS-MIB.py | 14 ++++++------- pysnmp/smi/mibs/PYSNMP-MIB.py | 14 ++++++------- pysnmp/smi/mibs/PYSNMP-SOURCE-MIB.py | 18 ++++++++-------- pysnmp/smi/mibs/PYSNMP-USM-MIB.py | 20 +++++++++--------- pysnmp/smi/mibs/RFC1158-MIB.py | 4 ++-- pysnmp/smi/mibs/RFC1213-MIB.py | 14 ++++++------- pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py | 18 ++++++++-------- pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py | 14 ++++++------- pysnmp/smi/mibs/SNMP-MPD-MIB.py | 14 ++++++------- pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py | 18 ++++++++-------- pysnmp/smi/mibs/SNMP-PROXY-MIB.py | 18 ++++++++-------- pysnmp/smi/mibs/SNMP-TARGET-MIB.py | 16 +++++++------- .../smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py | 16 +++++++------- pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py | 16 +++++++------- pysnmp/smi/mibs/SNMP-USM-AES-MIB.py | 16 +++++++------- pysnmp/smi/mibs/SNMP-USM-HMAC-SHA2-MIB.py | 16 +++++++------- pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py | 16 +++++++------- pysnmp/smi/mibs/SNMPv2-CONF.py | 4 ++-- pysnmp/smi/mibs/SNMPv2-MIB.py | 14 ++++++------- pysnmp/smi/mibs/SNMPv2-SMI.py | 18 ++++++++-------- pysnmp/smi/mibs/SNMPv2-TC.py | 10 ++++----- pysnmp/smi/mibs/SNMPv2-TM.py | 10 ++++----- pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py | 14 ++++++------- pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.py | 6 +++--- .../mibs/instances/__SNMP-FRAMEWORK-MIB.py | 6 +++--- pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.py | 6 +++--- .../smi/mibs/instances/__SNMP-TARGET-MIB.py | 6 +++--- .../instances/__SNMP-USER-BASED-SM-MIB.py | 6 +++--- .../instances/__SNMP-VIEW-BASED-ACM-MIB.py | 6 +++--- pysnmp/smi/mibs/instances/__SNMPv2-MIB.py | 6 +++--- pysnmp/smi/view.py | 4 ++-- ...rt-between-pdu-varbinds-and-mib-objects.py | 10 ++++++++- 39 files changed, 231 insertions(+), 202 deletions(-) diff --git a/docs/source/faq/how-to-implement-agent-mib.rst b/docs/source/faq/how-to-implement-agent-mib.rst index 841b0b1e3..d3185662f 100644 --- a/docs/source/faq/how-to-implement-agent-mib.rst +++ b/docs/source/faq/how-to-implement-agent-mib.rst @@ -91,7 +91,7 @@ A. You need to create MibScalarInstance class instances and register ) # add anonymous column instances - snmpEngine.get_mib_builder().exportSymbols( + snmpEngine.get_mib_builder().export_symbols( '_IP-MIB', _ipAddressAddrType, _ipAddressAddr, diff --git a/pyproject.toml b/pyproject.toml index 1fd3e3a20..f5aef0f7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,20 +38,20 @@ pytest-cov = "^4.1.0" pytest-asyncio = "^0.21.1" Sphinx = "^7.0.0" sphinx-copybutton = "^0.5.2" -furo = "^2023.1.1" +sphinx-notfound-page = "^1.0.0" sphinx-sitemap-lextudio = "^2.5.2" +sphinx-polyversion = "^1.0.0" +furo = "^2023.1.1" black = "23.1.0" pre-commit = "2.21.0" doc8 = "^1.0.0" -sphinx-notfound-page = "^1.0.0" -flake8 = "5.0.4" +flake8 = "^5.0.4" flake8-import-order = "^0.18.2" flake8-docstrings = "^1.7.0" flake8-rst-docstrings = "^0.3.0" -sphinx-polyversion = "^1.0.0" +pep8-naming = "^0.14.1" cryptography = "^43.0.1" pysmi = "^1.3.0" -pep8-naming = "^0.14.1" [tool.poetry_bumpversion.file."pysnmp/__init__.py"] diff --git a/pysnmp/smi/builder.py b/pysnmp/smi/builder.py index 6cbba7811..50ffd7ee9 100644 --- a/pysnmp/smi/builder.py +++ b/pysnmp/smi/builder.py @@ -467,7 +467,7 @@ def export_symbols(self, modName, *anonymousSyms, **namedSyms): for symObj in anonymousSyms: debug.logger & debug.FLAG_BLD and debug.logger( - "exportSymbols: anonymous symbol %s::__pysnmp_%ld" + "export_symbols: anonymous symbol %s::__pysnmp_%ld" % (modName, self._autoName) ) mibSymbols["__pysnmp_%ld" % self._autoName] = symObj @@ -486,7 +486,7 @@ def export_symbols(self, modName, *anonymousSyms, **namedSyms): mibSymbols[symName] = symObj debug.logger & debug.FLAG_BLD and debug.logger( - f"exportSymbols: symbol {modName}::{symName}" + f"export_symbols: symbol {modName}::{symName}" ) self.lastBuildId += 1 @@ -504,7 +504,7 @@ def unexport_symbols(self, modName, *symNames): del mibSymbols[symName] debug.logger & debug.FLAG_BLD and debug.logger( - f"unexportSymbols: symbol {modName}::{symName}" + f"unexport_symbols: symbol {modName}::{symName}" ) if not self.mibSymbols[modName]: diff --git a/pysnmp/smi/indices.py b/pysnmp/smi/indices.py index 2451af59d..9a68e95bb 100644 --- a/pysnmp/smi/indices.py +++ b/pysnmp/smi/indices.py @@ -4,6 +4,7 @@ # Copyright (c) 2005-2020, Ilya Etingof # License: https://www.pysnmp.com/pysnmp/license.html # +import warnings from bisect import bisect @@ -103,6 +104,26 @@ def get_keys_lengths(self): self.__order() return self.__keysLens + # Compatibility API + # compatibility with legacy code + # Old to new attribute mapping + deprecated_attributes = { + "nextKey": "next_key", + "getKeysLens": "get_keys_lengths", + } + + def __getattr__(self, attr: str): + if new_attr := self.deprecated_attributes.get(attr): + warnings.warn( + f"{attr} is deprecated. Please use {new_attr} instead.", + DeprecationWarning, + stacklevel=2, + ) + return getattr(self, new_attr) + raise AttributeError( + f"'{self.__class__.__name__}' object has no attribute '{attr}'" + ) + class OidOrderedDict(OrderedDict): """OID-ordered dictionary used for indices.""" diff --git a/pysnmp/smi/mibs/ASN1-ENUMERATION.py b/pysnmp/smi/mibs/ASN1-ENUMERATION.py index bcbe88d2e..b10b8ecb0 100644 --- a/pysnmp/smi/mibs/ASN1-ENUMERATION.py +++ b/pysnmp/smi/mibs/ASN1-ENUMERATION.py @@ -6,4 +6,4 @@ # from pyasn1.type import namedval -mibBuilder.exportSymbols("ASN1-ENUMERATION", NamedValues=namedval.NamedValues) +mibBuilder.export_symbols("ASN1-ENUMERATION", NamedValues=namedval.NamedValues) diff --git a/pysnmp/smi/mibs/ASN1-REFINEMENT.py b/pysnmp/smi/mibs/ASN1-REFINEMENT.py index af49a15d0..f29e21d03 100644 --- a/pysnmp/smi/mibs/ASN1-REFINEMENT.py +++ b/pysnmp/smi/mibs/ASN1-REFINEMENT.py @@ -6,7 +6,7 @@ # from pyasn1.type import constraint -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "ASN1-REFINEMENT", ConstraintsUnion=constraint.ConstraintsUnion, ConstraintsIntersection=constraint.ConstraintsIntersection, diff --git a/pysnmp/smi/mibs/ASN1.py b/pysnmp/smi/mibs/ASN1.py index c4677d42f..52dde5624 100644 --- a/pysnmp/smi/mibs/ASN1.py +++ b/pysnmp/smi/mibs/ASN1.py @@ -7,7 +7,7 @@ from pyasn1.type import univ from pysnmp.proto import rfc1902 -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "ASN1", ObjectIdentifier=univ.ObjectIdentifier, # Instead of using base ASN,1 types we use SNMPv2 SMI ones to make diff --git a/pysnmp/smi/mibs/INET-ADDRESS-MIB.py b/pysnmp/smi/mibs/INET-ADDRESS-MIB.py index 41264f7cd..ce04fb489 100644 --- a/pysnmp/smi/mibs/INET-ADDRESS-MIB.py +++ b/pysnmp/smi/mibs/INET-ADDRESS-MIB.py @@ -12,17 +12,17 @@ # from pysnmp.smi import error -ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols( +ObjectIdentifier, Integer, OctetString = mibBuilder.import_symbols( "ASN1", "ObjectIdentifier", "Integer", "OctetString" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", @@ -30,7 +30,7 @@ "ConstraintsUnion", "SingleValueConstraint", ) -NotificationGroup, ModuleCompliance = mibBuilder.importSymbols( +NotificationGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ModuleCompliance" ) ( @@ -52,7 +52,7 @@ Unsigned32, ObjectIdentity, ModuleIdentity, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "Gauge32", "iso", @@ -73,7 +73,7 @@ "ObjectIdentity", "ModuleIdentity", ) -TextualConvention, DisplayString = mibBuilder.importSymbols( +TextualConvention, DisplayString = mibBuilder.import_symbols( "SNMPv2-TC", "TextualConvention", "DisplayString" ) inetAddressMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 76)) @@ -257,7 +257,7 @@ class InetVersion(TextualConvention, Integer32): namedValues = NamedValues(("unknown", 0), ("ipv4", 1), ("ipv6", 2)) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "INET-ADDRESS-MIB", inetAddressMIB=inetAddressMIB, InetVersion=InetVersion, diff --git a/pysnmp/smi/mibs/PYSNMP-MIB.py b/pysnmp/smi/mibs/PYSNMP-MIB.py index 48a396e25..d94e41406 100644 --- a/pysnmp/smi/mibs/PYSNMP-MIB.py +++ b/pysnmp/smi/mibs/PYSNMP-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols( +Integer, OctetString, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "Integer", "OctetString", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", @@ -28,7 +28,7 @@ "ValueSizeConstraint", "ConstraintsUnion", ) -NotificationGroup, ModuleCompliance = mibBuilder.importSymbols( +NotificationGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ModuleCompliance" ) ( @@ -50,7 +50,7 @@ Integer32, enterprises, TimeTicks, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "ModuleIdentity", "iso", @@ -71,7 +71,7 @@ "enterprises", "TimeTicks", ) -TextualConvention, DisplayString = mibBuilder.importSymbols( +TextualConvention, DisplayString = mibBuilder.import_symbols( "SNMPv2-TC", "TextualConvention", "DisplayString" ) pysnmp = ModuleIdentity((1, 3, 6, 1, 4, 1, 20408)) @@ -105,7 +105,7 @@ pysnmpConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 5)) pysnmpCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 5, 1)) pysnmpGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 5, 2)) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "PYSNMP-MIB", pysnmpCompliances=pysnmpCompliances, pysnmpObjects=pysnmpObjects, diff --git a/pysnmp/smi/mibs/PYSNMP-SOURCE-MIB.py b/pysnmp/smi/mibs/PYSNMP-SOURCE-MIB.py index cd750f5ff..62c681c3f 100644 --- a/pysnmp/smi/mibs/PYSNMP-SOURCE-MIB.py +++ b/pysnmp/smi/mibs/PYSNMP-SOURCE-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols( +Integer, OctetString, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "Integer", "OctetString", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", @@ -28,11 +28,11 @@ "ValueSizeConstraint", "ConstraintsUnion", ) -(pysnmpModuleIDs,) = mibBuilder.importSymbols("PYSNMP-MIB", "pysnmpModuleIDs") -(snmpTargetAddrEntry,) = mibBuilder.importSymbols( +(pysnmpModuleIDs,) = mibBuilder.import_symbols("PYSNMP-MIB", "pysnmpModuleIDs") +(snmpTargetAddrEntry,) = mibBuilder.import_symbols( "SNMP-TARGET-MIB", "snmpTargetAddrEntry" ) -NotificationGroup, ModuleCompliance = mibBuilder.importSymbols( +NotificationGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ModuleCompliance" ) ( @@ -53,7 +53,7 @@ Bits, Integer32, TimeTicks, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "ModuleIdentity", "iso", @@ -73,7 +73,7 @@ "Integer32", "TimeTicks", ) -TextualConvention, DisplayString, TAddress = mibBuilder.importSymbols( +TextualConvention, DisplayString, TAddress = mibBuilder.import_symbols( "SNMPv2-TC", "TextualConvention", "DisplayString", "TAddress" ) pysnmpSourceMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 20408, 3, 1, 8)) @@ -129,7 +129,7 @@ ) pysnmpSourceMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 8, 2, 1)) pysnmpSourceMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 8, 2, 2)) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "PYSNMP-SOURCE-MIB", pysnmpSourceMIBConformance=pysnmpSourceMIBConformance, pysnmpSourceMIB=pysnmpSourceMIB, diff --git a/pysnmp/smi/mibs/PYSNMP-USM-MIB.py b/pysnmp/smi/mibs/PYSNMP-USM-MIB.py index 4724a9e5d..ef80df2ef 100644 --- a/pysnmp/smi/mibs/PYSNMP-USM-MIB.py +++ b/pysnmp/smi/mibs/PYSNMP-USM-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols( +Integer, OctetString, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "Integer", "OctetString", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", @@ -28,10 +28,10 @@ "ValueSizeConstraint", "ConstraintsUnion", ) -(pysnmpModuleIDs,) = mibBuilder.importSymbols("PYSNMP-MIB", "pysnmpModuleIDs") -(SnmpAdminString,) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") -(usmUserEntry,) = mibBuilder.importSymbols("SNMP-USER-BASED-SM-MIB", "usmUserEntry") -NotificationGroup, ModuleCompliance = mibBuilder.importSymbols( +(pysnmpModuleIDs,) = mibBuilder.import_symbols("PYSNMP-MIB", "pysnmpModuleIDs") +(SnmpAdminString,) = mibBuilder.import_symbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") +(usmUserEntry,) = mibBuilder.import_symbols("SNMP-USER-BASED-SM-MIB", "usmUserEntry") +NotificationGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ModuleCompliance" ) ( @@ -52,7 +52,7 @@ Bits, Integer32, TimeTicks, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "ModuleIdentity", "iso", @@ -72,7 +72,7 @@ "Integer32", "TimeTicks", ) -RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols( +RowStatus, DisplayString, TextualConvention = mibBuilder.import_symbols( "SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention" ) pysnmpUsmMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1)) @@ -263,7 +263,7 @@ pysnmpUsmKeyPriv.setDescription("User's non-localized key used for encryption.") pysnmpUsmMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 2, 1)) pysnmpUsmMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 2, 2)) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "PYSNMP-USM-MIB", pysnmpUsmCfg=pysnmpUsmCfg, pysnmpUsmDiscoverable=pysnmpUsmDiscoverable, diff --git a/pysnmp/smi/mibs/RFC1158-MIB.py b/pysnmp/smi/mibs/RFC1158-MIB.py index 118d3254b..4b1ddf2f4 100644 --- a/pysnmp/smi/mibs/RFC1158-MIB.py +++ b/pysnmp/smi/mibs/RFC1158-MIB.py @@ -25,7 +25,7 @@ MibIdentifier, Bits, Counter32, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "Integer32", "MibScalar", @@ -49,6 +49,6 @@ ) if mibBuilder.loadTexts: snmpOutReadOnlys.setStatus("mandatory") -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "RFC1158-MIB", snmpOutReadOnlys=snmpOutReadOnlys, snmpInBadTypes=snmpInBadTypes ) diff --git a/pysnmp/smi/mibs/RFC1213-MIB.py b/pysnmp/smi/mibs/RFC1213-MIB.py index 3abb06b07..5df996b9d 100644 --- a/pysnmp/smi/mibs/RFC1213-MIB.py +++ b/pysnmp/smi/mibs/RFC1213-MIB.py @@ -15,17 +15,17 @@ # from pysnmp.proto.rfc1155 import NetworkAddress -OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols( +OctetString, ObjectIdentifier, Integer = mibBuilder.import_symbols( "ASN1", "OctetString", "ObjectIdentifier", "Integer" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", @@ -33,7 +33,7 @@ "ConstraintsUnion", "ValueRangeConstraint", ) -ModuleCompliance, NotificationGroup = mibBuilder.importSymbols( +ModuleCompliance, NotificationGroup = mibBuilder.import_symbols( "SNMPv2-CONF", "ModuleCompliance", "NotificationGroup" ) ( @@ -56,7 +56,7 @@ iso, Counter64, mib_2, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "IpAddress", "TimeTicks", @@ -78,7 +78,7 @@ "Counter64", "mib-2", ) -DisplayString, PhysAddress = mibBuilder.importSymbols( +DisplayString, PhysAddress = mibBuilder.import_symbols( "SNMPv2-TC", "DisplayString", "PhysAddress" ) @@ -1271,7 +1271,7 @@ egpAs.setStatus("mandatory") if mibBuilder.loadTexts: egpAs.setDescription("The autonomous system number of this EGP entity.") -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "RFC1213-MIB", ipAdEntReasmMaxSize=ipAdEntReasmMaxSize, icmpOutAddrMasks=icmpOutAddrMasks, diff --git a/pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py b/pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py index 9eed6edb1..973170369 100644 --- a/pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py +++ b/pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols( +OctetString, ObjectIdentifier, Integer = mibBuilder.import_symbols( "ASN1", "OctetString", "ObjectIdentifier", "Integer" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", @@ -28,13 +28,13 @@ "ValueSizeConstraint", "SingleValueConstraint", ) -SnmpAdminString, SnmpEngineID = mibBuilder.importSymbols( +SnmpAdminString, SnmpEngineID = mibBuilder.import_symbols( "SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpEngineID" ) -snmpTargetAddrEntry, SnmpTagValue = mibBuilder.importSymbols( +snmpTargetAddrEntry, SnmpTagValue = mibBuilder.import_symbols( "SNMP-TARGET-MIB", "snmpTargetAddrEntry", "SnmpTagValue" ) -NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols( +NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance" ) ( @@ -56,7 +56,7 @@ snmpModules, iso, ObjectIdentity, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "Unsigned32", "MibScalar", @@ -77,7 +77,7 @@ "iso", "ObjectIdentity", ) -DisplayString, RowStatus, StorageType, TextualConvention = mibBuilder.importSymbols( +DisplayString, RowStatus, StorageType, TextualConvention = mibBuilder.import_symbols( "SNMPv2-TC", "DisplayString", "RowStatus", "StorageType", "TextualConvention" ) snmpCommunityMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 18)) @@ -308,7 +308,7 @@ snmpProxyTrapForwardGroup.setDescription( "Objects which are used by proxy forwarding applications when translating traps between SNMP versions. These are used to preserve SNMPv1-specific information when translating to SNMPv2c or SNMPv3." ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-COMMUNITY-MIB", PYSNMP_MODULE_ID=snmpCommunityMIB, snmpCommunityMIBFullCompliance=snmpCommunityMIBFullCompliance, diff --git a/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py b/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py index f44bd184c..9b0ef9a28 100644 --- a/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py +++ b/pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py @@ -18,17 +18,17 @@ except ImportError: pass -OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols( +OctetString, ObjectIdentifier, Integer = mibBuilder.import_symbols( "ASN1", "OctetString", "ObjectIdentifier", "Integer" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", @@ -36,7 +36,7 @@ "ConstraintsUnion", "ConstraintsIntersection", ) -ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols( +ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance" ) ( @@ -58,7 +58,7 @@ MibTableColumn, TimeTicks, NotificationType, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "Gauge32", "Unsigned32", @@ -79,7 +79,7 @@ "TimeTicks", "NotificationType", ) -DisplayString, TextualConvention = mibBuilder.importSymbols( +DisplayString, TextualConvention = mibBuilder.import_symbols( "SNMPv2-TC", "DisplayString", "TextualConvention" ) snmpFrameworkMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 10)) @@ -254,7 +254,7 @@ class SnmpSecurityLevel(Integer32, TextualConvention): snmpEngineGroup.setDescription( "A collection of objects for identifying and determining the configuration and current timeliness values of an SNMP engine. " ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-FRAMEWORK-MIB", snmpFrameworkMIBConformance=snmpFrameworkMIBConformance, snmpFrameworkMIB=snmpFrameworkMIB, diff --git a/pysnmp/smi/mibs/SNMP-MPD-MIB.py b/pysnmp/smi/mibs/SNMP-MPD-MIB.py index a77a0543d..542294749 100644 --- a/pysnmp/smi/mibs/SNMP-MPD-MIB.py +++ b/pysnmp/smi/mibs/SNMP-MPD-MIB.py @@ -11,17 +11,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols( +OctetString, ObjectIdentifier, Integer = mibBuilder.import_symbols( "ASN1", "OctetString", "ObjectIdentifier", "Integer" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", @@ -29,7 +29,7 @@ "ValueRangeConstraint", "ConstraintsIntersection", ) -NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols( +NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup" ) ( @@ -51,7 +51,7 @@ Counter64, IpAddress, snmpModules, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "iso", "Counter32", @@ -72,7 +72,7 @@ "IpAddress", "snmpModules", ) -DisplayString, TextualConvention = mibBuilder.importSymbols( +DisplayString, TextualConvention = mibBuilder.import_symbols( "SNMPv2-TC", "DisplayString", "TextualConvention" ) snmpMPDMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 11)) @@ -142,7 +142,7 @@ snmpMPDGroup.setDescription( "A collection of objects providing for remote monitoring of the SNMP Message Processing and Dispatching process. " ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-MPD-MIB", snmpMPDMIBGroups=snmpMPDMIBGroups, PYSNMP_MODULE_ID=snmpMPDMIB, diff --git a/pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py b/pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py index d781c77e2..c07024181 100644 --- a/pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py +++ b/pysnmp/smi/mibs/SNMP-NOTIFICATION-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols( +OctetString, Integer, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "OctetString", "Integer", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", @@ -28,11 +28,11 @@ "ValueSizeConstraint", "ConstraintsUnion", ) -(SnmpAdminString,) = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") -snmpTargetParamsName, SnmpTagValue = mibBuilder.importSymbols( +(SnmpAdminString,) = mibBuilder.import_symbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") +snmpTargetParamsName, SnmpTagValue = mibBuilder.import_symbols( "SNMP-TARGET-MIB", "snmpTargetParamsName", "SnmpTagValue" ) -NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols( +NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance" ) ( @@ -54,7 +54,7 @@ ObjectIdentity, NotificationType, Counter64, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "TimeTicks", "IpAddress", @@ -75,7 +75,7 @@ "NotificationType", "Counter64", ) -DisplayString, TextualConvention, RowStatus, StorageType = mibBuilder.importSymbols( +DisplayString, TextualConvention, RowStatus, StorageType = mibBuilder.import_symbols( "SNMPv2-TC", "DisplayString", "TextualConvention", "RowStatus", "StorageType" ) snmpNotificationMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 13)) @@ -342,7 +342,7 @@ snmpNotifyFilterGroup.setDescription( "A collection of objects providing remote configuration of notification filters." ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-NOTIFICATION-MIB", PYSNMP_MODULE_ID=snmpNotificationMIB, snmpNotifyFilterProfileTable=snmpNotifyFilterProfileTable, diff --git a/pysnmp/smi/mibs/SNMP-PROXY-MIB.py b/pysnmp/smi/mibs/SNMP-PROXY-MIB.py index d77d2f02d..a242f3f05 100644 --- a/pysnmp/smi/mibs/SNMP-PROXY-MIB.py +++ b/pysnmp/smi/mibs/SNMP-PROXY-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols( +ObjectIdentifier, Integer, OctetString = mibBuilder.import_symbols( "ASN1", "ObjectIdentifier", "Integer", "OctetString" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", @@ -28,11 +28,11 @@ "ValueRangeConstraint", "ConstraintsIntersection", ) -SnmpAdminString, SnmpEngineID = mibBuilder.importSymbols( +SnmpAdminString, SnmpEngineID = mibBuilder.import_symbols( "SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpEngineID" ) -(SnmpTagValue,) = mibBuilder.importSymbols("SNMP-TARGET-MIB", "SnmpTagValue") -ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols( +(SnmpTagValue,) = mibBuilder.import_symbols("SNMP-TARGET-MIB", "SnmpTagValue") +ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.import_symbols( "SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup" ) ( @@ -54,7 +54,7 @@ TimeTicks, Unsigned32, snmpModules, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "ModuleIdentity", "Counter64", @@ -75,7 +75,7 @@ "Unsigned32", "snmpModules", ) -TextualConvention, RowStatus, DisplayString, StorageType = mibBuilder.importSymbols( +TextualConvention, RowStatus, DisplayString, StorageType = mibBuilder.import_symbols( "SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString", "StorageType" ) snmpProxyMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 14)) @@ -228,7 +228,7 @@ snmpProxyGroup.setDescription( "A collection of objects providing remote configuration of management target translation parameters for use by proxy forwarder applications." ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-PROXY-MIB", snmpProxyObjects=snmpProxyObjects, snmpProxyType=snmpProxyType, diff --git a/pysnmp/smi/mibs/SNMP-TARGET-MIB.py b/pysnmp/smi/mibs/SNMP-TARGET-MIB.py index 9f76257aa..bc2807d40 100644 --- a/pysnmp/smi/mibs/SNMP-TARGET-MIB.py +++ b/pysnmp/smi/mibs/SNMP-TARGET-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols( +ObjectIdentifier, Integer, OctetString = mibBuilder.import_symbols( "ASN1", "ObjectIdentifier", "Integer", "OctetString" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", @@ -33,14 +33,14 @@ SnmpSecurityLevel, SnmpMessageProcessingModel, SnmpSecurityModel, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpSecurityLevel", "SnmpMessageProcessingModel", "SnmpSecurityModel", ) -ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols( +ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.import_symbols( "SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup" ) ( @@ -62,7 +62,7 @@ TimeTicks, Gauge32, Counter64, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "MibIdentifier", "MibScalar", @@ -92,7 +92,7 @@ StorageType, TDomain, DisplayString, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-TC", "TimeInterval", "RowStatus", @@ -432,7 +432,7 @@ def prettyIn(self, value): snmpTargetCommandResponderGroup.setDescription( "A collection of objects required for command responder applications, used for counting error conditions." ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-TARGET-MIB", snmpTargetAddrTimeout=snmpTargetAddrTimeout, SnmpTagValue=SnmpTagValue, diff --git a/pysnmp/smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py b/pysnmp/smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py index 350d00832..e83f25267 100644 --- a/pysnmp/smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py +++ b/pysnmp/smi/mibs/SNMP-USER-BASED-SM-3DES-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols( +Integer, ObjectIdentifier, OctetString = mibBuilder.import_symbols( "ASN1", "Integer", "ObjectIdentifier", "OctetString" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", @@ -28,10 +28,10 @@ "SingleValueConstraint", "ConstraintsIntersection", ) -(snmpPrivProtocols,) = mibBuilder.importSymbols( +(snmpPrivProtocols,) = mibBuilder.import_symbols( "SNMP-FRAMEWORK-MIB", "snmpPrivProtocols" ) -ModuleCompliance, NotificationGroup = mibBuilder.importSymbols( +ModuleCompliance, NotificationGroup = mibBuilder.import_symbols( "SNMPv2-CONF", "ModuleCompliance", "NotificationGroup" ) ( @@ -53,7 +53,7 @@ ModuleIdentity, iso, Counter32, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "Bits", "MibScalar", @@ -74,7 +74,7 @@ "iso", "Counter32", ) -TextualConvention, AutonomousType, DisplayString = mibBuilder.importSymbols( +TextualConvention, AutonomousType, DisplayString = mibBuilder.import_symbols( "SNMPv2-TC", "TextualConvention", "AutonomousType", "DisplayString" ) snmpUsmMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 15)) @@ -101,7 +101,7 @@ usm3DESEDEPrivProtocol.setReference( "- Data Encryption Standard, National Institute of Standards and Technology. Federal Information Processing Standard (FIPS) Publication 46-3, (1999, pending approval). Will supersede FIPS Publication 46-2. - Data Encryption Algorithm, American National Standards Institute. ANSI X3.92-1981, (December, 1980). - DES Modes of Operation, National Institute of Standards and Technology. Federal Information Processing Standard (FIPS) Publication 81, (December, 1980). - Data Encryption Algorithm - Modes of Operation, American National Standards Institute. ANSI X3.106-1983, (May 1983). " ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-USER-BASED-SM-3DES-MIB", snmpUsmMIB=snmpUsmMIB, PYSNMP_MODULE_ID=snmpUsmMIB, diff --git a/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py b/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py index 0c771e692..3a93a097d 100644 --- a/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py +++ b/pysnmp/smi/mibs/SNMP-USER-BASED-SM-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols( +OctetString, Integer, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "OctetString", "Integer", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", @@ -33,14 +33,14 @@ snmpAuthProtocols, snmpPrivProtocols, SnmpEngineID, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMP-FRAMEWORK-MIB", "SnmpAdminString", "snmpAuthProtocols", "snmpPrivProtocols", "SnmpEngineID", ) -ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols( +ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.import_symbols( "SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup" ) ( @@ -62,7 +62,7 @@ ModuleIdentity, snmpModules, ObjectIdentity, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "MibScalar", "MibTable", @@ -91,7 +91,7 @@ TextualConvention, RowPointer, TestAndIncr, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-TC", "DisplayString", "AutonomousType", @@ -410,7 +410,7 @@ class KeyChange(TextualConvention, OctetString): usmMIBBasicGroup.setDescription( "A collection of objects providing for configuration of an SNMP engine which implements the SNMP User-based Security Model. " ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-USER-BASED-SM-MIB", usmUserStorageType=usmUserStorageType, PYSNMP_MODULE_ID=snmpUsmMIB, diff --git a/pysnmp/smi/mibs/SNMP-USM-AES-MIB.py b/pysnmp/smi/mibs/SNMP-USM-AES-MIB.py index b3bb21ac0..4aae6c7db 100644 --- a/pysnmp/smi/mibs/SNMP-USM-AES-MIB.py +++ b/pysnmp/smi/mibs/SNMP-USM-AES-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols( +OctetString, Integer, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "OctetString", "Integer", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", @@ -28,10 +28,10 @@ "ValueRangeConstraint", "ConstraintsIntersection", ) -(snmpPrivProtocols,) = mibBuilder.importSymbols( +(snmpPrivProtocols,) = mibBuilder.import_symbols( "SNMP-FRAMEWORK-MIB", "snmpPrivProtocols" ) -NotificationGroup, ModuleCompliance = mibBuilder.importSymbols( +NotificationGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ModuleCompliance" ) ( @@ -53,7 +53,7 @@ MibTableRow, MibTableColumn, Counter64, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "Counter32", "iso", @@ -74,7 +74,7 @@ "MibTableColumn", "Counter64", ) -DisplayString, TextualConvention = mibBuilder.importSymbols( +DisplayString, TextualConvention = mibBuilder.import_symbols( "SNMPv2-TC", "DisplayString", "TextualConvention" ) snmpUsmAesMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 20)) @@ -101,7 +101,7 @@ usmAesCfb128Protocol.setReference( "- Specification for the ADVANCED ENCRYPTION STANDARD. Federal Information Processing Standard (FIPS) Publication 197. (November 2001). - Dworkin, M., NIST Recommendation for Block Cipher Modes of Operation, Methods and Techniques. NIST Special Publication 800-38A (December 2001). " ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-USM-AES-MIB", usmAesCfb128Protocol=usmAesCfb128Protocol, snmpUsmAesMIB=snmpUsmAesMIB, diff --git a/pysnmp/smi/mibs/SNMP-USM-HMAC-SHA2-MIB.py b/pysnmp/smi/mibs/SNMP-USM-HMAC-SHA2-MIB.py index df6992f36..ec5b510d2 100644 --- a/pysnmp/smi/mibs/SNMP-USM-HMAC-SHA2-MIB.py +++ b/pysnmp/smi/mibs/SNMP-USM-HMAC-SHA2-MIB.py @@ -5,17 +5,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols( +OctetString, Integer, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "OctetString", "Integer", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", @@ -23,10 +23,10 @@ "ConstraintsIntersection", "ValueRangeConstraint", ) -(snmpAuthProtocols,) = mibBuilder.importSymbols( +(snmpAuthProtocols,) = mibBuilder.import_symbols( "SNMP-FRAMEWORK-MIB", "snmpAuthProtocols" ) -NotificationGroup, ModuleCompliance = mibBuilder.importSymbols( +NotificationGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ModuleCompliance" ) ( @@ -48,7 +48,7 @@ NotificationType, IpAddress, Integer32, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "Counter32", "Bits", @@ -69,7 +69,7 @@ "IpAddress", "Integer32", ) -TextualConvention, DisplayString = mibBuilder.importSymbols( +TextualConvention, DisplayString = mibBuilder.import_symbols( "SNMPv2-TC", "TextualConvention", "DisplayString" ) snmpUsmHmacSha2MIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 235)) @@ -136,7 +136,7 @@ usmHMAC384SHA512AuthProtocol.setReference( "- Krawczyk, H., Bellare, M., and R. Canetti, HMAC: Keyed-Hashing for Message Authentication, RFC 2104. - National Institute of Standards and Technology, Secure Hash Standard (SHS), FIPS PUB 180-4, 2012." ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-USM-HMAC-SHA2-MIB", usmHMAC256SHA384AuthProtocol=usmHMAC256SHA384AuthProtocol, usmHMAC192SHA256AuthProtocol=usmHMAC192SHA256AuthProtocol, diff --git a/pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py b/pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py index cb102de8e..c2e1beabd 100644 --- a/pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py +++ b/pysnmp/smi/mibs/SNMP-VIEW-BASED-ACM-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols( +OctetString, Integer, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "OctetString", "Integer", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", @@ -28,10 +28,10 @@ "ConstraintsUnion", "SingleValueConstraint", ) -SnmpAdminString, SnmpSecurityLevel, SnmpSecurityModel = mibBuilder.importSymbols( +SnmpAdminString, SnmpSecurityLevel, SnmpSecurityModel = mibBuilder.import_symbols( "SNMP-FRAMEWORK-MIB", "SnmpAdminString", "SnmpSecurityLevel", "SnmpSecurityModel" ) -NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols( +NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup" ) ( @@ -53,7 +53,7 @@ ObjectIdentity, iso, Counter32, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "TimeTicks", "Gauge32", @@ -80,7 +80,7 @@ TextualConvention, DisplayString, StorageType, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-TC", "TestAndIncr", "RowStatus", @@ -455,7 +455,7 @@ vacmBasicGroup.setDescription( "A collection of objects providing for remote configuration of an SNMP engine which implements the SNMP View-based Access Control Model. " ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMP-VIEW-BASED-ACM-MIB", vacmSecurityModel=vacmSecurityModel, vacmSecurityToGroupEntry=vacmSecurityToGroupEntry, diff --git a/pysnmp/smi/mibs/SNMPv2-CONF.py b/pysnmp/smi/mibs/SNMPv2-CONF.py index 20f96ae8c..7787e62a9 100644 --- a/pysnmp/smi/mibs/SNMPv2-CONF.py +++ b/pysnmp/smi/mibs/SNMPv2-CONF.py @@ -10,7 +10,7 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -(MibNode,) = mibBuilder.importSymbols("SNMPv2-SMI", "MibNode") +(MibNode,) = mibBuilder.import_symbols("SNMPv2-SMI", "MibNode") class ObjectGroup(MibNode): @@ -177,7 +177,7 @@ def asn1Print(self): ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMPv2-CONF", ObjectGroup=ObjectGroup, NotificationGroup=NotificationGroup, diff --git a/pysnmp/smi/mibs/SNMPv2-MIB.py b/pysnmp/smi/mibs/SNMPv2-MIB.py index 9946d4135..bae3fbd46 100644 --- a/pysnmp/smi/mibs/SNMPv2-MIB.py +++ b/pysnmp/smi/mibs/SNMPv2-MIB.py @@ -10,17 +10,17 @@ # On host grommit.local platform Darwin version 16.4.0 by user ilya # Using Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) # -OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols( +OctetString, ObjectIdentifier, Integer = mibBuilder.import_symbols( "ASN1", "OctetString", "ObjectIdentifier", "Integer" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", @@ -28,7 +28,7 @@ "ValueRangeConstraint", "ConstraintsUnion", ) -ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols( +ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.import_symbols( "SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup" ) ( @@ -51,7 +51,7 @@ Unsigned32, TimeTicks, MibIdentifier, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "mib-2", "snmpModules", @@ -73,7 +73,7 @@ "TimeTicks", "MibIdentifier", ) -TextualConvention, TestAndIncr, TimeStamp, DisplayString = mibBuilder.importSymbols( +TextualConvention, TestAndIncr, TimeStamp, DisplayString = mibBuilder.import_symbols( "SNMPv2-TC", "TextualConvention", "TestAndIncr", "TimeStamp", "DisplayString" ) snmpMIB = ModuleIdentity((1, 3, 6, 1, 6, 3, 1)) @@ -666,7 +666,7 @@ snmpObsoleteGroup.setDescription( "A collection of objects from RFC 1213 made obsolete by this MIB module." ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMPv2-MIB", snmpOutBadValues=snmpOutBadValues, coldStart=coldStart, diff --git a/pysnmp/smi/mibs/SNMPv2-SMI.py b/pysnmp/smi/mibs/SNMPv2-SMI.py index d79448d16..b8857316e 100644 --- a/pysnmp/smi/mibs/SNMPv2-SMI.py +++ b/pysnmp/smi/mibs/SNMPv2-SMI.py @@ -16,7 +16,7 @@ from pysnmp.smi.indices import OidOrderedDict -Integer, ObjectIdentifier = mibBuilder.importSymbols( +Integer, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "Integer", "ObjectIdentifier" ) @@ -26,7 +26,7 @@ SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", @@ -1300,7 +1300,7 @@ def announceManagementEvent(self, action, varBind, **context): baseIndices = [] indices = [] for impliedFlag, modName, symName in self.indexNames: - (mibObj,) = mibBuilder.importSymbols(modName, symName) + (mibObj,) = mibBuilder.import_symbols(modName, symName) syntax, instId = self.setFromName( mibObj.syntax, instId, impliedFlag, indices ) @@ -1319,7 +1319,7 @@ def announceManagementEvent(self, action, varBind, **context): return for modName, mibSym in self.augmentingRows: - (mibObj,) = mibBuilder.importSymbols(modName, mibSym) + (mibObj,) = mibBuilder.import_symbols(modName, mibSym) debug.logger & debug.FLAG_INS and debug.logger( f"announceManagementEvent {action} to {mibObj}" ) @@ -1332,7 +1332,7 @@ def receiveManagementEvent(self, action, varBind, **context): newSuffix = () # Resolve indices intersection for impliedFlag, modName, symName in self.indexNames: - (mibObj,) = mibBuilder.importSymbols(modName, symName) + (mibObj,) = mibBuilder.import_symbols(modName, symName) parentIndices = [] for name, syntax in baseIndices: if name == mibObj.name: @@ -1370,7 +1370,7 @@ def __manageColumns(self, action, excludeName, varBind, **context): instId = nameSuffix indices = [] for impliedFlag, modName, symName in self.indexNames: - (mibObj,) = mibBuilder.importSymbols(modName, symName) + (mibObj,) = mibBuilder.import_symbols(modName, symName) syntax, instId = self.setFromName( mibObj.syntax, instId, impliedFlag, indices ) @@ -1480,7 +1480,7 @@ def getIndicesFromInstId(self, instId): indices = [] for impliedFlag, modName, symName in self.indexNames: - (mibObj,) = mibBuilder.importSymbols(modName, symName) + (mibObj,) = mibBuilder.import_symbols(modName, symName) try: syntax, instId = self.setFromName( mibObj.syntax, instId, impliedFlag, indices @@ -1519,7 +1519,7 @@ def getInstIdFromIndices(self, *indices): for impliedFlag, modName, symName in self.indexNames: if idx >= len(indices): break - (mibObj,) = mibBuilder.importSymbols(modName, symName) + (mibObj,) = mibBuilder.import_symbols(modName, symName) syntax = mibObj.syntax.clone(indices[idx]) instId += self.getAsName(syntax, impliedFlag, parentIndices) parentIndices.append(syntax) @@ -1573,7 +1573,7 @@ def __init__(self, name): snmpProxys = MibIdentifier(snmpV2.name + (2,)) snmpModules = MibIdentifier(snmpV2.name + (3,)) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMPv2-SMI", MibNode=MibNode, Integer32=Integer32, diff --git a/pysnmp/smi/mibs/SNMPv2-TC.py b/pysnmp/smi/mibs/SNMPv2-TC.py index c347c6cc5..4b0c127bf 100644 --- a/pysnmp/smi/mibs/SNMPv2-TC.py +++ b/pysnmp/smi/mibs/SNMPv2-TC.py @@ -21,17 +21,17 @@ SmiError, ) -OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols( +OctetString, Integer, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "OctetString", "Integer", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", @@ -39,7 +39,7 @@ "ValueRangeConstraint", "ValueSizeConstraint", ) -Counter32, Unsigned32, TimeTicks, Counter64 = mibBuilder.importSymbols( +Counter32, Unsigned32, TimeTicks, Counter64 = mibBuilder.import_symbols( "SNMPv2-SMI", "Counter32", "Unsigned32", "TimeTicks", "Counter64" ) @@ -617,7 +617,7 @@ class TAddress(TextualConvention, OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 255) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMPv2-TC", TextualConvention=TextualConvention, DisplayString=DisplayString, diff --git a/pysnmp/smi/mibs/SNMPv2-TM.py b/pysnmp/smi/mibs/SNMPv2-TM.py index 8c65d4917..fea25d774 100644 --- a/pysnmp/smi/mibs/SNMPv2-TM.py +++ b/pysnmp/smi/mibs/SNMPv2-TM.py @@ -19,14 +19,14 @@ inet_pton = lambda x, y: inet_aton(y) -(OctetString,) = mibBuilder.importSymbols("ASN1", "OctetString") +(OctetString,) = mibBuilder.import_symbols("ASN1", "OctetString") ( ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", @@ -41,7 +41,7 @@ snmpModules, snmpDomains, snmpProxys, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "ModuleIdentity", "MibIdentifier", @@ -50,7 +50,7 @@ "snmpDomains", "snmpProxys", ) -(TextualConvention,) = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention") +(TextualConvention,) = mibBuilder.import_symbols("SNMPv2-TC", "TextualConvention") snmpv2tm = ModuleIdentity((1, 3, 6, 1, 6, 3, 19)) if mibBuilder.loadTexts: @@ -178,7 +178,7 @@ class SnmpIPXAddress(TextualConvention, OctetString): "The transport domain for SNMPv1 over UDP over IPv4. The corresponding transport address is of type SnmpUDPAddress." ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "SNMPv2-TM", SnmpNBPAddress=SnmpNBPAddress, rfc1157Domain=rfc1157Domain, diff --git a/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py b/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py index 759b04523..9344afe38 100644 --- a/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py +++ b/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py @@ -115,17 +115,17 @@ def inet_ntop(address_family, packed_ip): return ":".join([f(x) for x in groups]) -Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols( +Integer, OctetString, ObjectIdentifier = mibBuilder.import_symbols( "ASN1", "Integer", "OctetString", "ObjectIdentifier" ) -(NamedValues,) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") +(NamedValues,) = mibBuilder.import_symbols("ASN1-ENUMERATION", "NamedValues") ( ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", @@ -133,7 +133,7 @@ def inet_ntop(address_family, packed_ip): "ValueSizeConstraint", "SingleValueConstraint", ) -NotificationGroup, ModuleCompliance = mibBuilder.importSymbols( +NotificationGroup, ModuleCompliance = mibBuilder.import_symbols( "SNMPv2-CONF", "NotificationGroup", "ModuleCompliance" ) ( @@ -155,7 +155,7 @@ def inet_ntop(address_family, packed_ip): IpAddress, iso, mib_2, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-SMI", "Integer32", "Unsigned32", @@ -176,7 +176,7 @@ def inet_ntop(address_family, packed_ip): "iso", "mib-2", ) -DisplayString, TextualConvention = mibBuilder.importSymbols( +DisplayString, TextualConvention = mibBuilder.import_symbols( "SNMPv2-TC", "DisplayString", "TextualConvention" ) transportAddressMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 100)) @@ -451,7 +451,7 @@ class TransportAddressDns(TextualConvention, OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 255) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "TRANSPORT-ADDRESS-MIB", transportDomainUdpIpv6=transportDomainUdpIpv6, TransportDomain=TransportDomain, diff --git a/pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.py b/pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.py index 2078097ee..706c525cd 100644 --- a/pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.py +++ b/pysnmp/smi/mibs/instances/__PYSNMP-USM-MIB.py @@ -4,13 +4,13 @@ # Copyright (c) 2005-2020, Ilya Etingof # License: https://www.pysnmp.com/pysnmp/license.html # -(MibScalarInstance,) = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalarInstance") +(MibScalarInstance,) = mibBuilder.import_symbols("SNMPv2-SMI", "MibScalarInstance") ( pysnmpUsmDiscoverable, pysnmpUsmDiscovery, pysnmpUsmKeyType, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "PYSNMP-USM-MIB", "pysnmpUsmDiscoverable", "pysnmpUsmDiscovery", "pysnmpUsmKeyType" ) @@ -24,7 +24,7 @@ pysnmpUsmKeyType.name, (0,), pysnmpUsmKeyType.syntax ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "__PYSNMP-USM-MIB", pysnmpUsmDiscoverable=__pysnmpUsmDiscoverable, pysnmpUsmDiscovery=__pysnmpUsmDiscovery, diff --git a/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py b/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py index 3ed268fc6..6ccdfb511 100644 --- a/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py +++ b/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py @@ -6,14 +6,14 @@ # import time -(MibScalarInstance,) = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalarInstance") +(MibScalarInstance,) = mibBuilder.import_symbols("SNMPv2-SMI", "MibScalarInstance") ( snmpEngineID, snmpEngineBoots, snmpEngineTime, snmpEngineMaxMessageSize, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMP-FRAMEWORK-MIB", "snmpEngineID", "snmpEngineBoots", @@ -32,7 +32,7 @@ snmpEngineMaxMessageSize.name, (0,), snmpEngineMaxMessageSize.syntax.clone(4096) ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "__SNMP-FRAMEWORK-MIB", snmpEngineID=__snmpEngineID, snmpEngineBoots=__snmpEngineBoots, diff --git a/pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.py b/pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.py index 86ad6c6be..e5c6c1463 100644 --- a/pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.py +++ b/pysnmp/smi/mibs/instances/__SNMP-MPD-MIB.py @@ -4,13 +4,13 @@ # Copyright (c) 2005-2020, Ilya Etingof # License: https://www.pysnmp.com/pysnmp/license.html # -(MibScalarInstance,) = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalarInstance") +(MibScalarInstance,) = mibBuilder.import_symbols("SNMPv2-SMI", "MibScalarInstance") ( snmpUnknownSecurityModels, snmpInvalidMsgs, snmpUnknownPDUHandlers, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMP-MPD-MIB", "snmpUnknownSecurityModels", "snmpInvalidMsgs", @@ -27,7 +27,7 @@ snmpUnknownPDUHandlers.name, (0,), snmpUnknownPDUHandlers.syntax.clone(0) ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "__SNMP-MPD-MIB", snmpUnknownSecurityModels=__snmpUnknownSecurityModels, snmpInvalidMsgs=__snmpInvalidMsgs, diff --git a/pysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.py b/pysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.py index d606a3800..cfc9aef57 100644 --- a/pysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.py +++ b/pysnmp/smi/mibs/instances/__SNMP-TARGET-MIB.py @@ -4,13 +4,13 @@ # Copyright (c) 2005-2020, Ilya Etingof # License: https://www.pysnmp.com/pysnmp/license.html # -(MibScalarInstance,) = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalarInstance") +(MibScalarInstance,) = mibBuilder.import_symbols("SNMPv2-SMI", "MibScalarInstance") ( snmpTargetSpinLock, snmpUnavailableContexts, snmpUnknownContexts, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMP-TARGET-MIB", "snmpTargetSpinLock", "snmpUnavailableContexts", @@ -27,7 +27,7 @@ snmpUnknownContexts.name, (0,), snmpUnknownContexts.syntax.clone(0) ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "__SNMP-TARGET-MIB", snmpTargetSpinLock=__snmpTargetSpinLock, snmpUnavailableContexts=__snmpUnavailableContexts, diff --git a/pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.py b/pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.py index 6a92e15a3..5cf96804c 100644 --- a/pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.py +++ b/pysnmp/smi/mibs/instances/__SNMP-USER-BASED-SM-MIB.py @@ -4,7 +4,7 @@ # Copyright (c) 2005-2020, Ilya Etingof # License: https://www.pysnmp.com/pysnmp/license.html # -(MibScalarInstance,) = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalarInstance") +(MibScalarInstance,) = mibBuilder.import_symbols("SNMPv2-SMI", "MibScalarInstance") ( usmStatsUnsupportedSecLevels, @@ -14,7 +14,7 @@ usmStatsWrongDigests, usmStatsDecryptionErrors, usmUserSpinLock, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMP-USER-BASED-SM-MIB", "usmStatsUnsupportedSecLevels", "usmStatsNotInTimeWindows", @@ -49,7 +49,7 @@ usmUserSpinLock.name, (0,), usmUserSpinLock.syntax.clone(0) ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "__SNMP-USER-BASED-SM-MIB", usmStatsUnsupportedSecLevels=__usmStatsUnsupportedSecLevels, usmStatsNotInTimeWindows=__usmStatsNotInTimeWindows, diff --git a/pysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.py b/pysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.py index 92c288781..c7c7a9b68 100644 --- a/pysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.py +++ b/pysnmp/smi/mibs/instances/__SNMP-VIEW-BASED-ACM-MIB.py @@ -4,9 +4,9 @@ # Copyright (c) 2005-2020, Ilya Etingof # License: https://www.pysnmp.com/pysnmp/license.html # -(MibScalarInstance,) = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalarInstance") +(MibScalarInstance,) = mibBuilder.import_symbols("SNMPv2-SMI", "MibScalarInstance") -(vacmViewSpinLock,) = mibBuilder.importSymbols( +(vacmViewSpinLock,) = mibBuilder.import_symbols( "SNMP-VIEW-BASED-ACM-MIB", "vacmViewSpinLock" ) @@ -14,6 +14,6 @@ vacmViewSpinLock.name, (0,), vacmViewSpinLock.syntax ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "__SNMP-VIEW-BASED-ACM-MIB", vacmViewSpinLock=__vacmViewSpinLock ) diff --git a/pysnmp/smi/mibs/instances/__SNMPv2-MIB.py b/pysnmp/smi/mibs/instances/__SNMPv2-MIB.py index 29db92963..00318caa0 100644 --- a/pysnmp/smi/mibs/instances/__SNMPv2-MIB.py +++ b/pysnmp/smi/mibs/instances/__SNMPv2-MIB.py @@ -9,7 +9,7 @@ from pysnmp import __version__ -(MibScalarInstance, TimeTicks) = mibBuilder.importSymbols( +(MibScalarInstance, TimeTicks) = mibBuilder.import_symbols( "SNMPv2-SMI", "MibScalarInstance", "TimeTicks" ) @@ -53,7 +53,7 @@ snmpTrapOID, coldStart, snmpSetSerialNo, -) = mibBuilder.importSymbols( +) = mibBuilder.import_symbols( "SNMPv2-MIB", "sysDescr", "sysObjectID", @@ -212,7 +212,7 @@ def clone(self, **kwargs): snmpSetSerialNo.name, (0,), snmpSetSerialNo.syntax.clone(0) ) -mibBuilder.exportSymbols( +mibBuilder.export_symbols( "__SNMPv2-MIB", sysDescr=__sysDescr, sysObjectID=__sysObjectID, diff --git a/pysnmp/smi/view.py b/pysnmp/smi/view.py index bba3272f9..98a07425f 100644 --- a/pysnmp/smi/view.py +++ b/pysnmp/smi/view.py @@ -281,7 +281,7 @@ def get_next_node_name(self, nodeName, modName=""): oid, label, suffix = self.get_node_name(nodeName, modName) try: return self.get_node_name( - self.__mibSymbolsIdx[modName]["oidToLabelIdx"].nextKey(oid) + suffix, + self.__mibSymbolsIdx[modName]["oidToLabelIdx"].next_key(oid) + suffix, modName, ) except KeyError: @@ -346,7 +346,7 @@ def get_next_type(self, typeName, modName=""): """Get next type name.""" m, t = self.get_type_name(typeName, modName) try: - return self.__mibSymbolsIdx[m]["typeToModIdx"].nextKey(t) + return self.__mibSymbolsIdx[m]["typeToModIdx"].next_key(t) except KeyError: raise error.NoSuchObjectError( str=f"No type next to {modName}::{typeName} at {self}" diff --git a/tests/smi/manager/test_convert-between-pdu-varbinds-and-mib-objects.py b/tests/smi/manager/test_convert-between-pdu-varbinds-and-mib-objects.py index 86d635bb5..29313db25 100644 --- a/tests/smi/manager/test_convert-between-pdu-varbinds-and-mib-objects.py +++ b/tests/smi/manager/test_convert-between-pdu-varbinds-and-mib-objects.py @@ -3,10 +3,18 @@ from pysnmp.smi import builder, view, rfc1902, error -def test_addAsn1MibSource(): +def test_add_asn1_mib_source(): mibBuilder = builder.MibBuilder() mibView = view.MibViewController(mibBuilder) mibVar = rfc1902.ObjectIdentity("IF-MIB", "ifInOctets", 1) mibVar.add_asn1_mib_source("https://mibs.pysnmp.com/asn1/@mib@") mibVar.resolve_with_mib(mibView) assert mibVar.prettyPrint() == "IF-MIB::ifInOctets.1" + + next_module = mibView.get_next_module_name("IF-MIB") + assert next_module == "SNMPv2-CONF" + + oid, label, suffix = mibView.get_first_node_name() + oid, label, suffix = mibView.get_next_node_name(oid) + assert oid == (0, 0) + assert label == ("itu-t", "zeroDotZero")