[master 2/2] Don't pass unused mountpoint dict to preCommitFixup.

dwlehman installerbot-noreply at redhat.com
Fri May 8 15:18:59 UTC 2015


From: David Lehman <dlehman at redhat.com>

The previous commit removed MDRaidArrayDevice.preCommitFixup, which
was the reason we began passing the mountpoints.

Related: rhbz#1061711
---
 blivet/actionlist.py        | 16 ++++++----------
 blivet/devices/partition.py |  2 +-
 blivet/devices/storage.py   |  2 +-
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/blivet/actionlist.py b/blivet/actionlist.py
index eed5c2c..97d5761 100644
--- a/blivet/actionlist.py
+++ b/blivet/actionlist.py
@@ -22,7 +22,7 @@
 
 import copy
 
-from .deviceaction import ActionCreateDevice, ActionDestroyDevice
+from .deviceaction import ActionCreateDevice
 from .deviceaction import action_type_from_string, action_object_from_string
 from .devicelibs import lvm
 from .devices import PartitionDevice
@@ -184,16 +184,12 @@ def _preProcess(self, devices=None):
                device.originalFormat != device.format:
                 device.originalFormat.resetPartedDisk()
 
-        # Call preCommitFixup on all devices
-        mpoints = [getattr(d.format, 'mountpoint', "") for d in devices]
-        for device in devices:
-            device.preCommitFixup(mountpoints=mpoints)
-
-        # Also call preCommitFixup on any devices we're going to
+        # Call preCommitFixup on all devices, including those we're going to
         # destroy (these are already removed from the tree)
-        for action in self._actions:
-            if isinstance(action, ActionDestroyDevice):
-                action.device.preCommitFixup(mountpoints=mpoints)
+        fixup_devices = devices + [a.device for a in self._actions
+                                                if a.isDestroy and a.isDevice]
+        for device in fixup_devices:
+            device.preCommitFixup()
 
         # setup actions to create any extended partitions we added
         #
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
index 4071935..cd81363 100644
--- a/blivet/devices/partition.py
+++ b/blivet/devices/partition.py
@@ -337,7 +337,7 @@ def _setPartedPartition(self, partition):
     partedPartition = property(lambda d: d._getPartedPartition(),
                                lambda d,p: d._setPartedPartition(p))
 
-    def preCommitFixup(self, *args, **kwargs):
+    def preCommitFixup(self):
         """ Re-get self.partedPartition from the original disklabel. """
         log_method_call(self, self.name)
         if not self.exists:
diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
index 052b397..f4eda63 100644
--- a/blivet/devices/storage.py
+++ b/blivet/devices/storage.py
@@ -628,7 +628,7 @@ def _getFormat(self):
                       lambda d,f: d._setFormat(f),
                       doc="The device's formatting.")
 
-    def preCommitFixup(self, *args, **kwargs):
+    def preCommitFixup(self):
         """ Do any necessary pre-commit fixups."""
         pass
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/9fd74ff3b2e4926702d5fe3cae60c90c3a91a1a7


More information about the anaconda-patches mailing list