diff options
author | elie <elie> | 2008-02-05 20:13:53 +0000 |
---|---|---|
committer | elie <elie> | 2008-02-05 20:13:53 +0000 |
commit | 22f65b8679c9489353b57280662397c0d06c55b4 (patch) | |
tree | 3b8b508f76fbe98709624248d37a224df24eb2fe | |
parent | b383ab0e10df6d691359a746557bd03f227fc5de (diff) | |
download | pysnmp-22f65b8679c9489353b57280662397c0d06c55b4.tar.gz |
MsgAndPduDispatcher now takes optional MibInstrumController instance
-rw-r--r-- | pysnmp/proto/rfc3412.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pysnmp/proto/rfc3412.py b/pysnmp/proto/rfc3412.py index fe81771..db97322 100644 --- a/pysnmp/proto/rfc3412.py +++ b/pysnmp/proto/rfc3412.py @@ -10,10 +10,14 @@ class MsgAndPduDispatcher: """SNMP engine PDU & message dispatcher. Exchanges SNMP PDU's with applications and serialized messages with transport level. """ - def __init__(self): - self.mibInstrumController = instrum.MibInstrumController( - builder.MibBuilder() - ) + def __init__(self, mibInstrumController=None): + if mibInstrumController is None: + self.mibInstrumController = instrum.MibInstrumController( + builder.MibBuilder() + ) + else: + self.mibInstrumController = mibInstrumController + self.mibInstrumController.mibBuilder.loadModules( 'SNMPv2-MIB', 'SNMP-MPD-MIB', 'SNMP-COMMUNITY-MIB', 'SNMP-TARGET-MIB', 'SNMP-USER-BASED-SM-MIB' |