diff options
| author | Christian Heimes <cheimes@redhat.com> | 2016-03-04 23:54:04 +0100 |
|---|---|---|
| committer | Christian Heimes <cheimes@redhat.com> | 2016-03-04 23:55:22 +0100 |
| commit | 9e78f981e923c879033c26eebad0cb803d66b8d9 (patch) | |
| tree | b3239148d894136b4b3ad8ccd6c4bed3f5c49bb2 /base/server/python | |
| parent | afb989113ee3816396a2c0f95ac1579b3a4c42c6 (diff) | |
| download | pki-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__.py | 6 |
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) |
