diff options
author | elie <elie> | 2013-03-16 08:03:08 +0000 |
---|---|---|
committer | elie <elie> | 2013-03-16 08:03:08 +0000 |
commit | b10f3817ed2b3e92f464cd286d5992e7aa1281c0 (patch) | |
tree | cd8691e56077154156bf4bf2dd720b05b058fa3d /examples | |
parent | 17e1ed73da0e6f45223472329061c10fa43183ea (diff) | |
download | pysnmp-b10f3817ed2b3e92f464cd286d5992e7aa1281c0.tar.gz |
no need to catch errorStatus == 2 when not using SNMPv1
Diffstat (limited to 'examples')
-rw-r--r-- | examples/v3arch/manager/cmdgen/get-v2c-custom-timeout.py | 4 | ||||
-rw-r--r-- | examples/v3arch/manager/cmdgen/getnext-v2c-from-specific-address.py | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/examples/v3arch/manager/cmdgen/get-v2c-custom-timeout.py b/examples/v3arch/manager/cmdgen/get-v2c-custom-timeout.py index 5c9e19c..f852327 100644 --- a/examples/v3arch/manager/cmdgen/get-v2c-custom-timeout.py +++ b/examples/v3arch/manager/cmdgen/get-v2c-custom-timeout.py @@ -54,9 +54,7 @@ def cbFun(sendRequestHandle, varBinds, cbCtx): if errorIndication: print(errorIndication) - # SNMPv1 response may contain noSuchName error *and* SNMPv2c exception, - # so we ignore noSuchName error here - elif errorStatus and errorStatus != 2: + elif errorStatus: print('%s at %s' % ( errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex)-1][0] or '?' diff --git a/examples/v3arch/manager/cmdgen/getnext-v2c-from-specific-address.py b/examples/v3arch/manager/cmdgen/getnext-v2c-from-specific-address.py index 53fd983..9d31305 100644 --- a/examples/v3arch/manager/cmdgen/getnext-v2c-from-specific-address.py +++ b/examples/v3arch/manager/cmdgen/getnext-v2c-from-specific-address.py @@ -54,9 +54,7 @@ def cbFun(sendRequestHandle, if errorIndication: print(errorIndication) return - # SNMPv1 response may contain noSuchName error *and* SNMPv2c exception, - # so we ignore noSuchName error here - if errorStatus and errorStatus != 2: + if errorStatus: print('%s at %s' % ( errorStatus.prettyPrint(), errorIndex and varBindTable[-1][int(errorIndex)-1][0] or '?' |