summaryrefslogtreecommitdiff
path: root/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py')
-rw-r--r--examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
index a3686d69..7f1f8d2c 100644
--- a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
+++ b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
@@ -20,20 +20,21 @@ Functionally similar to:
"""#
from pysnmp.hlapi.v1arch import *
-for (errorIndication,
- errorStatus,
- errorIndex,
- varBinds) in bulkCmd(SnmpDispatcher(),
- CommunityData('public'),
- UdpTransportTarget(('demo.snmplabs.com', 161)),
- 0, 50,
- ObjectType(
- ObjectIdentity('TCP-MIB', 'tcpConnTable').addMibSource(
- '/opt/mibs/pysnmp').addMibSource(
- 'python_packaged_mibs')
- ),
- lookupMib=True,
- lexicographicMode=False):
+iterator = bulkCmd(
+ SnmpDispatcher(),
+ CommunityData('public'),
+ UdpTransportTarget(('demo.snmplabs.com', 161)),
+ 0, 50,
+ ObjectType(
+ ObjectIdentity('TCP-MIB', 'tcpConnTable').addMibSource(
+ '/opt/mibs/pysnmp').addMibSource(
+ 'python_packaged_mibs')
+ ),
+ lookupMib=True,
+ lexicographicMode=False
+)
+
+for errorIndication, errorStatus, errorIndex, varBinds in iterator:
if errorIndication:
print(errorIndication)