Blame SOURCES/pki-core-Make-PKIInstance-and-PKISubsystem-hashable.patch
|
|
018a91 |
From 361c708d5854786d8c80dd9864818137d733661c Mon Sep 17 00:00:00 2001
|
|
|
018a91 |
From: Christian Heimes <cheimes@redhat.com>
|
|
|
018a91 |
Date: Fri, 4 Mar 2016 23:54:04 +0100
|
|
|
018a91 |
Subject: [PATCH] Make PKIInstance and PKISubsystem hashable
|
|
|
018a91 |
|
|
|
018a91 |
The upgrade uses instance and subsystem as keys for dicts.
|
|
|
018a91 |
|
|
|
018a91 |
(cherry picked from commit 9e78f981e923c879033c26eebad0cb803d66b8d9)
|
|
|
018a91 |
|
|
|
018a91 |
Conflicts:
|
|
|
018a91 |
tests/python/server/test_server.py
|
|
|
018a91 |
---
|
|
|
018a91 |
base/server/python/pki/server/__init__.py | 6 ++++--
|
|
|
018a91 |
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
018a91 |
|
|
|
018a91 |
diff --git a/base/server/python/pki/server/__init__.py b/base/server/python/pki/server/__init__.py
|
|
|
018a91 |
index 971a3f6..0f61f2a 100644
|
|
|
018a91 |
--- a/base/server/python/pki/server/__init__.py
|
|
|
018a91 |
+++ b/base/server/python/pki/server/__init__.py
|
|
|
018a91 |
@@ -109,7 +109,8 @@ class PKISubsystem(object):
|
|
|
018a91 |
self.instance < other.instance or
|
|
|
018a91 |
self_type < other_type)
|
|
|
018a91 |
|
|
|
018a91 |
- __hash__ = None
|
|
|
018a91 |
+ def __hash__(self):
|
|
|
018a91 |
+ return hash((self.name, self.instance, self.type))
|
|
|
018a91 |
|
|
|
018a91 |
def load(self):
|
|
|
018a91 |
self.config.clear()
|
|
|
018a91 |
@@ -391,7 +392,8 @@ class PKIInstance(object):
|
|
|
018a91 |
return (self.name < other.name or
|
|
|
018a91 |
self.type < other.type)
|
|
|
018a91 |
|
|
|
018a91 |
- __hash__ = None
|
|
|
018a91 |
+ def __hash__(self):
|
|
|
018a91 |
+ return hash((self.name, self.type))
|
|
|
018a91 |
|
|
|
018a91 |
def is_valid(self):
|
|
|
018a91 |
return os.path.exists(self.conf_dir)
|
|
|
018a91 |
--
|
|
|
018a91 |
1.8.3.1
|
|
|
018a91 |
|