diff options
author | Ilya Etingof <etingof@gmail.com> | 2016-04-01 22:58:56 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2016-04-01 22:58:56 +0200 |
commit | 020791a97232849c9504024834906dd4a4ffb36c (patch) | |
tree | 6e5d69aa01877ee004efb77645b8148e586610cc /examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py | |
parent | 9541f201e33cd613995cee2e7a7656aa687deb51 (diff) | |
download | pysnmp-git-020791a97232849c9504024834906dd4a4ffb36c.tar.gz |
pep8 reformatted
Diffstat (limited to 'examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py')
-rw-r--r-- | examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py b/examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py index 2cd37cda..29c480c1 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py +++ b/examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py @@ -49,6 +49,7 @@ config.addTargetAddr( 'my-creds' ) + # Error/response receiver # noinspection PyUnusedLocal,PyUnusedLocal,PyUnusedLocal def cbFun(snmpEngine, sendRequesthandle, errorIndication, @@ -57,25 +58,23 @@ def cbFun(snmpEngine, sendRequesthandle, errorIndication, print(errorIndication) return # stop on error if errorStatus: - print('%s at %s' % ( - errorStatus.prettyPrint(), - errorIndex and varBindTable[-1][int(errorIndex)-1][0] or '?' - ) - ) + print('%s at %s' % (errorStatus.prettyPrint(), + errorIndex and varBindTable[-1][int(errorIndex) - 1][0] or '?')) return # stop on error for varBindRow in varBindTable: for oid, val in varBindRow: print('%s = %s' % (oid.prettyPrint(), val.prettyPrint())) - return True # signal dispatcher to continue walking + return True # signal dispatcher to continue walking + # Prepare initial request to be sent cmdgen.BulkCommandGenerator().sendVarBinds( snmpEngine, 'my-router', None, '', # contextEngineId, contextName - 0, 25, # non-repeaters, max-repetitions - [ ((1,3,6,1,2,1,1), None), - ((1,3,6,1,4,1,1), None) ], + 0, 25, # non-repeaters, max-repetitions + [((1, 3, 6, 1, 2, 1, 1), None), + ((1, 3, 6, 1, 4, 1, 1), None)], cbFun ) |