diff options
author | elie <elie> | 2007-11-23 11:37:59 +0000 |
---|---|---|
committer | elie <elie> | 2007-11-23 11:37:59 +0000 |
commit | 71d51ce958deb2766134c5d477008fddb8bfa61a (patch) | |
tree | eb795cfbd06043c031aefeeefd5f96e63764185e | |
parent | 8e43aedc7d33531852596ebba2b3806d362ae8bc (diff) | |
download | pysnmp-71d51ce958deb2766134c5d477008fddb8bfa61a.tar.gz |
configuration classes made hashable to track their committment
into CommandGenerator/NotificationOriginator internal repositories
-rw-r--r-- | pysnmp/entity/rfc3413/oneliner/cmdgen.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pysnmp/entity/rfc3413/oneliner/cmdgen.py b/pysnmp/entity/rfc3413/oneliner/cmdgen.py index b0f5917..677fe4f 100644 --- a/pysnmp/entity/rfc3413/oneliner/cmdgen.py +++ b/pysnmp/entity/rfc3413/oneliner/cmdgen.py @@ -26,6 +26,7 @@ class CommunityData: if mpModel is not None: self.mpModel = mpModel self.securityModel = mpModel + 1 + self.__hash = hash((self.mpModel, self.securityModel, self.securityLevel, self.securityName, self.communityName)) def __repr__(self): return '%s("%s", <COMMUNITY>, %s)' % ( self.__class__.__name__, @@ -33,6 +34,8 @@ class CommunityData: self.mpModel ) + def __hash__(self): return self.__hash + class UsmUserData: authKey = privKey = None authProtocol = usmNoAuthProtocol @@ -64,12 +67,16 @@ class UsmUserData: else: self.privProtocol = privProtocol + self.__hash = hash((self.mpModel, self.securityModel, self.securityLevel, self.securityName, self.authProtocol, self.authKey, self.privProtocol, self.privKey)) + def __repr__(self): return '%s("%s", <AUTHKEY>, <PRIVKEY>, %s, %s)' % ( self.__class__.__name__, self.securityName, self.authProtocol, self.privProtocol ) + + def __hash__(self): return self.__hash class UdpTransportTarget: transportDomain = udp.domainName |