summaryrefslogtreecommitdiffstats
path: root/base/server/python
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2016-03-04 23:54:04 +0100
committerChristian Heimes <cheimes@redhat.com>2016-03-04 23:55:22 +0100
commit9e78f981e923c879033c26eebad0cb803d66b8d9 (patch)
treeb3239148d894136b4b3ad8ccd6c4bed3f5c49bb2 /base/server/python
parentafb989113ee3816396a2c0f95ac1579b3a4c42c6 (diff)
downloadpki-9e78f981e923c879033c26eebad0cb803d66b8d9.tar.gz
pki-9e78f981e923c879033c26eebad0cb803d66b8d9.tar.xz
pki-9e78f981e923c879033c26eebad0cb803d66b8d9.zip
Make PKIInstance and PKISubsystem hashable
The upgrade uses instance and subsystem as keys for dicts.
Diffstat (limited to 'base/server/python')
-rw-r--r--base/server/python/pki/server/__init__.py6
1 files changed, 4 insertions, 2 deletions
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)