[follow-up b] Use the very same iscsi object when working with storage snaphots

Vratislav Podzimek vpodzime at redhat.com
Wed Oct 7 10:31:30 UTC 2015


The iscsi object is a singleton and thus all storage snapshots/copies should use
the instance.

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

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



More information about the anaconda-patches mailing list