summaryrefslogtreecommitdiff
path: root/examples/v3arch/manager
diff options
context:
space:
mode:
authorelie <elie>2010-11-14 08:30:18 +0000
committerelie <elie>2010-11-14 08:30:18 +0000
commitc770b66faac4527396f13ef3bd28ce7b187d8fe5 (patch)
tree4a088410331caa306e828338ebf059873cc00649 /examples/v3arch/manager
parentb439d79d3e5c0ab71b306678a7fc34c76cff3a6d (diff)
downloadpysnmp-c770b66faac4527396f13ef3bd28ce7b187d8fe5.tar.gz
fix to use errorIndex only when it is set (to non-zero)
Diffstat (limited to 'examples/v3arch/manager')
-rw-r--r--examples/v3arch/manager/setgen.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/v3arch/manager/setgen.py b/examples/v3arch/manager/setgen.py
index 0681025..4b90f31 100644
--- a/examples/v3arch/manager/setgen.py
+++ b/examples/v3arch/manager/setgen.py
@@ -51,10 +51,13 @@ snmpEngine.transportDispatcher.runDispatcher()
if cbCtx['errorIndication']:
print cbCtx['errorIndication']
elif cbCtx['errorStatus']:
- print '%s at %s' % (
- cbCtx['errorStatus'].prettyPrint(),
- cbCtx['varBinds'][int(cbCtx['errorIndex'])-1]
+ if cbCtx['errorIndex']:
+ print '%s at %s' % (
+ cbCtx['errorStatus'].prettyPrint(),
+ cbCtx['varBinds'][int(cbCtx['errorIndex'])-1]
)
+ else:
+ print cbCtx['errorStatus'].prettyPrint()
else:
for o, v in cbCtx['varBinds']:
print '%s = %s' % (o.prettyPrint(), v.prettyPrint())