From 40e76edfebc381f3210124144821d9ca185320e6 Mon Sep 17 00:00:00 2001 From: Lex Li Date: Mon, 26 Aug 2024 03:25:31 -0400 Subject: [PATCH] Revised to enforce ignoreErrors use. --- pysnmp/hlapi/varbinds.py | 4 +++- pysnmp/smi/rfc1902.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pysnmp/hlapi/varbinds.py b/pysnmp/hlapi/varbinds.py index b1e7099e..e61ebe91 100644 --- a/pysnmp/hlapi/varbinds.py +++ b/pysnmp/hlapi/varbinds.py @@ -47,7 +47,9 @@ def makeVarBinds(self, userCache: Dict[str, Any], varBinds): else: varBind = ObjectType(ObjectIdentity(varBind[0]), varBind[1]) - resolvedVarBinds.append(varBind.resolveWithMib(mibViewController)) + resolvedVarBinds.append( + varBind.resolveWithMib(mibViewController, ignoreErrors=False) + ) return resolvedVarBinds diff --git a/pysnmp/smi/rfc1902.py b/pysnmp/smi/rfc1902.py index d7641e22..94cfbabb 100644 --- a/pysnmp/smi/rfc1902.py +++ b/pysnmp/smi/rfc1902.py @@ -924,7 +924,7 @@ class instance representing MIB browsing functionality. Examples -------- >>> from pysmi.hlapi.asyncio import varbinds - >>> mibViewController = varbinds.AbstractVarBinds.getMibViewController( engine ) + >>> mibViewController = varbinds.MibViewControllerManager.getMibViewController(engine.cache) >>> objectType = ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr'), 'Linux i386') >>> objectType.resolveWithMib(mibViewController) ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr'), DisplayString('Linux i386'))