Skip to content

Commit

Permalink
Don't pass unused mountpoint dict to preCommitFixup.
Browse files Browse the repository at this point in the history
Related: rhbz#1061711
  • Loading branch information
dwlehman committed May 28, 2015
1 parent 8bce840 commit b679268
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
16 changes: 6 additions & 10 deletions blivet/actionlist.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
#
Expand Down
5 changes: 2 additions & 3 deletions blivet/devices/md.py
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion blivet/devices/partition.py
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion blivet/devices/storage.py
Expand Up @@ -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

Expand Down

0 comments on commit b679268

Please sign in to comment.