diff options
Diffstat (limited to 'examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py')
-rw-r--r-- | examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py index b54802af..a07208e7 100644 --- a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py +++ b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py @@ -17,11 +17,15 @@ Functionally similar to: """# from pysnmp.hlapi.v1arch import * -for response in getCmd(SnmpDispatcher(), - CommunityData('public', mpModel=0), - UdpTransportTarget(('demo.snmplabs.com', 161)), - ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr', 0)), - lookupMib=True): +iterator = getCmd( + SnmpDispatcher(), + CommunityData('public', mpModel=0), + UdpTransportTarget(('demo.snmplabs.com', 161)), + ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr', 0)), + lookupMib=True +) + +for response in iterator: errorIndication, errorStatus, errorIndex, varBinds = response |