summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2010-11-12 23:54:56 +0000
committerelie <elie>2010-11-12 23:54:56 +0000
commitfad2a39e677637a39499d887c835c146dda9bfc6 (patch)
treed1488d8aaf22429dd4d589866742918329fc460b
parent72ff9554b756544450b8d3e165131ca1dc5088ab (diff)
downloadpysnmp-fad2a39e677637a39499d887c835c146dda9bfc6.tar.gz
another fix to genErr errorIndex generation
-rw-r--r--pysnmp/entity/rfc3413/cmdrsp.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pysnmp/entity/rfc3413/cmdrsp.py b/pysnmp/entity/rfc3413/cmdrsp.py
index 7c0031d..b032cc5 100644
--- a/pysnmp/entity/rfc3413/cmdrsp.py
+++ b/pysnmp/entity/rfc3413/cmdrsp.py
@@ -174,9 +174,9 @@ class CommandResponderBase:
except pysnmp.smi.error.InconsistentNameError, errorIndication:
errorStatus, errorIndex = 'inconsistentName', errorIndication['idx'] + 1
except pysnmp.smi.error.SmiError, errorIndication:
- errorStatus, errorIndex = 'genErr', errorIndication.get('idx',-1)+1
+ errorStatus, errorIndex = 'genErr', len(varBinds) and 1 or 0
except pysnmp.error.PySnmpError, errorIndication:
- errorStatus, errorIndex = 'genErr', errorIndication.get('idx',-1)+1
+ errorStatus, errorIndex = 'genErr', len(varBinds) and 1 or 0
self.__sendResponse(
snmpEngine, errorStatus, errorIndex, varBinds, stateReference