[blivet][follow-up a v2] Do not create a copy of singleton objects

Vratislav Podzimek vpodzime at redhat.com
Wed Oct 7 10:55:46 UTC 2015


They are singletons and thus should only exist in single instances.

Related: rhbz#1267944
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 blivet/fcoe.py  | 3 +++
 blivet/iscsi.py | 3 +++
 blivet/zfcp.py  | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/blivet/fcoe.py b/blivet/fcoe.py
index b29ebb6..8ee1c5d 100644
--- a/blivet/fcoe.py
+++ b/blivet/fcoe.py
@@ -63,6 +63,9 @@ class fcoe(object):
     def __call__(self):
         return self
 
+    def __deepcopy__(self, memo_dict):
+        return self
+
     def _stabilize(self):
         # I have no clue how long we need to wait, this ought to do the trick
         time.sleep(10)
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
index 6c0d598..12bc6c9 100644
--- a/blivet/iscsi.py
+++ b/blivet/iscsi.py
@@ -149,6 +149,9 @@ class iscsi(object):
     def __call__(self):
         return self
 
+    def __deepcopy__(self, memo_dict):
+        return self
+
     def _getInitiator(self):
         if self._initiator != "":
             return self._initiator
diff --git a/blivet/zfcp.py b/blivet/zfcp.py
index dbc1269..e5d2140 100644
--- a/blivet/zfcp.py
+++ b/blivet/zfcp.py
@@ -333,6 +333,9 @@ class ZFCP:
     def __call__(self):
         return self
 
+    def __deepcopy__(self, memo_dict):
+        return self
+
     def readConfig(self):
         try:
             f = open(zfcpconf, "r")
-- 
2.1.0



More information about the anaconda-patches mailing list