diff options
Diffstat (limited to 'examples/v3arch/asyncore/manager/cmdgen/pull-subtree.py')
-rw-r--r-- | examples/v3arch/asyncore/manager/cmdgen/pull-subtree.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/pull-subtree.py b/examples/v3arch/asyncore/manager/cmdgen/pull-subtree.py index 36e461fb..cbaa1d0b 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/pull-subtree.py +++ b/examples/v3arch/asyncore/manager/cmdgen/pull-subtree.py @@ -52,6 +52,7 @@ config.addTargetAddr( 'my-creds' ) + # Error/response receiver # noinspection PyUnusedLocal,PyUnusedLocal,PyUnusedLocal def cbFun(snmpEngine, sendRequestHandle, errorIndication, @@ -60,26 +61,24 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication, print(errorIndication) return 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: if initialOID.isPrefixOf(oid): print('%s = %s' % (oid.prettyPrint(), val.prettyPrint())) else: - return False # signal dispatcher to stop - return True # signal dispatcher to continue + return False # signal dispatcher to stop + return True # signal dispatcher to continue + # Prepare initial request to be sent cmdgen.NextCommandGenerator().sendVarBinds( snmpEngine, 'my-router', None, '', # contextEngineId, contextName - [ (initialOID, None) ], + [(initialOID, None)], cbFun ) |