diff options
Diffstat (limited to 'examples/hlapi/twisted/manager/cmdgen/v1-get.py')
-rw-r--r-- | examples/hlapi/twisted/manager/cmdgen/v1-get.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/hlapi/twisted/manager/cmdgen/v1-get.py b/examples/hlapi/twisted/manager/cmdgen/v1-get.py index 051c58a8..6cb2f17e 100644 --- a/examples/hlapi/twisted/manager/cmdgen/v1-get.py +++ b/examples/hlapi/twisted/manager/cmdgen/v1-get.py @@ -18,17 +18,16 @@ Functionally similar to: from twisted.internet.task import react from pysnmp.hlapi.twisted import * + def success((errorStatus, errorIndex, varBinds), hostname): if errorStatus: - print('%s: %s at %s' % ( - hostname, - errorStatus.prettyPrint(), - errorIndex and varBinds[int(errorIndex)-1][0] or '?' - ) - ) + print('%s: %s at %s' % (hostname, + errorStatus.prettyPrint(), + errorIndex and varBinds[int(errorIndex) - 1][0] or '?')) else: for varBind in varBinds: - print(' = '.join([ x.prettyPrint() for x in varBind ])) + print(' = '.join([x.prettyPrint() for x in varBind])) + def failure(errorIndication, hostname): print('%s failure: %s' % (hostname, errorIndication)) @@ -46,4 +45,5 @@ def getSysDescr(reactor, hostname): return d + react(getSysDescr, ['demo.snmplabs.com']) |