From 9e78f981e923c879033c26eebad0cb803d66b8d9 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 4 Mar 2016 23:54:04 +0100 Subject: Make PKIInstance and PKISubsystem hashable The upgrade uses instance and subsystem as keys for dicts. --- base/server/python/pki/server/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'base/server/python') diff --git a/base/server/python/pki/server/__init__.py b/base/server/python/pki/server/__init__.py index abcce7167..114a6e461 100644 --- a/base/server/python/pki/server/__init__.py +++ b/base/server/python/pki/server/__init__.py @@ -115,7 +115,8 @@ class PKISubsystem(object): self.instance < other.instance or self_type < other_type) - __hash__ = None + def __hash__(self): + return hash((self.name, self.instance, self.type)) def load(self): self.config.clear() @@ -424,7 +425,8 @@ class PKIInstance(object): return (self.name < other.name or self.type < other.type) - __hash__ = None + def __hash__(self): + return hash((self.name, self.type)) def is_valid(self): return os.path.exists(self.conf_dir) -- cgit