diff options
author | elie <elie> | 2005-09-27 19:22:19 +0000 |
---|---|---|
committer | elie <elie> | 2005-09-27 19:22:19 +0000 |
commit | ac04b9fd52fb7cc66efd287132609fb16c36e30b (patch) | |
tree | 644ddb9bfd6ef4b8c586036b51ea8b8c40bb0fe4 /pysnmp | |
parent | d691520dd2731394c2fc9c3ebe5addb30e940dd3 (diff) | |
download | pysnmp-git-ac04b9fd52fb7cc66efd287132609fb16c36e30b.tar.gz |
avoid multiple registration of the same transport
Diffstat (limited to 'pysnmp')
-rw-r--r-- | pysnmp/hlapi/asyncore/cmdgen.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pysnmp/hlapi/asyncore/cmdgen.py b/pysnmp/hlapi/asyncore/cmdgen.py index b348d539..d6d8e0e5 100644 --- a/pysnmp/hlapi/asyncore/cmdgen.py +++ b/pysnmp/hlapi/asyncore/cmdgen.py @@ -76,6 +76,7 @@ class AsynCommandGenerator: ) self.__knownAuths = {} self.__knownTransports = {} + self.__knownTransportAddrs = {} def __configure(self, authData, transportTarget): paramsName = '%s-params' % (authData.securityName,) @@ -106,21 +107,24 @@ class AsynCommandGenerator: raise error.PySnmpError('Unsupported SNMP version') self.__knownAuths[authData] = 1 - addrName = str(transportTarget.transportAddr) - if not self.__knownTransports.has_key(transportTarget): + if not self.__knownTransports.has_key(transportTarget.transport): config.addSocketTransport( self.snmpEngine, transportTarget.transportDomain, transportTarget.transport ) - self.__knownTransports[transportTarget] = 1 - + self.__knownTransports[transportTarget.transport] = 1 + + addrName = str(transportTarget.transportAddr) + if not self.__knownTransportAddrs.has_key(addrName): config.addTargetAddr( self.snmpEngine, addrName, transportTarget.transportDomain, transportTarget.transportAddr, paramsName ) + self.__knownTransportAddrs[addrName] = 1 + return addrName # Async SNMP apps |