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

dwlehman installerbot-noreply at redhat.com
Thu May 28 15:27:32 UTC 2015


From: David Lehman <dlehman at redhat.com>

Related: rhbz#1061711
---
 blivet/actionlist.py        | 16 ++++++----------
 blivet/devices/md.py        |  5 ++---
 blivet/devices/partition.py |  2 +-
 blivet/devices/storage.py   |  2 +-
 4 files changed, 10 insertions(+), 15 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/md.py b/blivet/devices/md.py
index 67b0d7b..036a785 100644
--- a/blivet/devices/md.py
+++ b/blivet/devices/md.py
@@ -453,10 +453,9 @@ def teardown(self, recursive=None):
 
         self._postTeardown(recursive=recursive)
 
-    def preCommitFixup(self, *args, **kwargs):
+    def preCommitFixup(self):
         """ Determine create parameters for this set """
-        mountpoints = kwargs.pop("mountpoints")
-        log_method_call(self, self.name, mountpoints)
+        log_method_call(self, self.name)
         # UEFI firmware/bootloader cannot read 1.1 or 1.2 metadata arrays
         if getattr(self.format, "mountpoint", None) == "/boot/efi":
             self.metadataVersion = "1.0"
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/b6792689cfe45a19d8350905641a85445f40d590


More information about the anaconda-patches mailing list