summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2010-06-23 12:29:25 +0000
committerelie <elie>2010-06-23 12:29:25 +0000
commit7940592a7b20cc884b0cc4ba7c833732a1bbdea6 (patch)
tree275c64cebe42e90b6bc9bc9d693b52b0dc3c8138
parentc83aba89c146995943a1be15f54706473ac9714f (diff)
downloadpysnmp-7940592a7b20cc884b0cc4ba7c833732a1bbdea6.tar.gz
fix to unknown contextName exception handling
-rw-r--r--pysnmp/entity/rfc3413/cmdrsp.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pysnmp/entity/rfc3413/cmdrsp.py b/pysnmp/entity/rfc3413/cmdrsp.py
index c1c8006..17bcd2f 100644
--- a/pysnmp/entity/rfc3413/cmdrsp.py
+++ b/pysnmp/entity/rfc3413/cmdrsp.py
@@ -119,8 +119,6 @@ class CommandResponderBase:
statusInformation
)
- contextMibInstrumCtl = self.snmpContext.getMibInstrum(contextName)
-
acCtx = (
snmpEngine, securityModel, securityName, securityLevel, contextName
)
@@ -130,7 +128,7 @@ class CommandResponderBase:
errorStatus, errorIndex = 'noError', 0
try:
errorStatus, errorIndex, varBinds = self._handleManagementOperation(
- snmpEngine, contextMibInstrumCtl, PDU,
+ snmpEngine, self.snmpContext.getMibInstrum(contextName), PDU,
(self.__verifyAccess, acCtx)
)
# SNMPv2 SMI exceptions
@@ -165,6 +163,8 @@ class CommandResponderBase:
errorStatus, errorIndex = 'inconsistentName', errorIndication['idx'] + 1
except pysnmp.smi.error.SmiError, errorIndication:
errorStatus, errorIndex = 'genErr', 1
+ except pysnmp.error.PySnmpError, errorIndication:
+ errorStatus, errorIndex = 'genErr', 1
self.__sendResponse(
snmpEngine, errorStatus, errorIndex, varBinds, stateReference