diff options
Diffstat (limited to 'examples/v1arch')
-rw-r--r-- | examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects.py | 4 | ||||
-rw-r--r-- | examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects.py b/examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects.py index 6c55aa45..9b3f992c 100644 --- a/examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects.py +++ b/examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects.py @@ -33,7 +33,7 @@ for mibVar in mibInstr: def cbFun(transportDispatcher, transportDomain, transportAddress, wholeMsg): while wholeMsg: msgVer = api.decodeMessageVersion(wholeMsg) - if api.protoModules.has_key(msgVer): + if msgVer in api.protoModules: pMod = api.protoModules[msgVer] else: print 'Unsupported SNMP version %s' % msgVer @@ -66,7 +66,7 @@ def cbFun(transportDispatcher, transportDomain, transportAddress, wholeMsg): ) elif reqPDU.isSameTypeWith(pMod.GetRequestPDU()): for oid, val in pMod.apiPDU.getVarBinds(reqPDU): - if mibInstrIdx.has_key(oid): + if oid in mibInstrIdx: varBinds.append((oid, mibInstrIdx[oid](msgVer))) else: # No such instance diff --git a/examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py b/examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py index 0287200e..a38c14cd 100644 --- a/examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py +++ b/examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py @@ -7,7 +7,7 @@ from pysnmp.proto import api def cbFun(transportDispatcher, transportDomain, transportAddress, wholeMsg): while wholeMsg: msgVer = int(api.decodeMessageVersion(wholeMsg)) - if api.protoModules.has_key(msgVer): + if msgVer in api.protoModules: pMod = api.protoModules[msgVer] else: print 'Unsupported SNMP version %s' % msgVer |