[really real v2] Use the very same iscsi, fcoe and zfcp objects for all storage snaphots

Vratislav Podzimek vpodzime at redhat.com
Wed Oct 7 10:51:57 UTC 2015


(okay, this thing is obviously killing me)

The objects are singletons and thus all storage snapshots/copies should use
the same instances.

Related: rhbz#1267944
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/storage_utils.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pyanaconda/storage_utils.py b/pyanaconda/storage_utils.py
index 59a5f4a..9989167 100644
--- a/pyanaconda/storage_utils.py
+++ b/pyanaconda/storage_utils.py
@@ -389,6 +389,9 @@ class StorageSnapshot(object):
         """Create (and save) snapshot of storage"""
 
         self._storage_snap = storage.copy()
+        self._orig_iscsi = storage.iscsi
+        self._orig_fcoe = storage.fcoe
+        self._orig_zfcp = storage.zfcp
 
     def dispose_snapshot(self):
         """
@@ -417,6 +420,10 @@ class StorageSnapshot(object):
         # by further changes of 'storage'
         new_copy = self._storage_snap.copy()
         storage.devicetree = new_copy.devicetree
+        storage.devicetree.iscsi = self._orig_iscsi
+        storage.iscsi = self._orig_iscsi
+        storage.fcoe = self._orig_fcoe
+        storage.zfcp = self._orig_zfcp
         storage.roots = new_copy.roots
         storage.fsset = new_copy.fsset
 
-- 
2.1.0



More information about the anaconda-patches mailing list