From 5131eacc40d770429491ed253cedf77cf6673062 Mon Sep 17 00:00:00 2001 From: elie Date: Fri, 14 Oct 2005 16:09:47 +0000 Subject: handle strange SNMP versions --- examples/v1arch/agent/cmdrsp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/v1arch/agent/cmdrsp.py b/examples/v1arch/agent/cmdrsp.py index e0031b1..6da674c 100644 --- a/examples/v1arch/agent/cmdrsp.py +++ b/examples/v1arch/agent/cmdrsp.py @@ -33,7 +33,11 @@ for mibVar in mibInstr: def cbFun(transportDispatcher, transportDomain, transportAddress, wholeMsg): while wholeMsg: msgVer = api.decodeMessageVersion(wholeMsg) - pMod = api.protoModules[msgVer] + if api.protoModules.has_key(msgVer): + pMod = api.protoModules[msgVer] + else: + print 'Unsupported SNMP version %s' % msgVer + return reqMsg, wholeMsg = decoder.decode( wholeMsg, asn1Spec=pMod.Message(), ) -- cgit v1.2.1