--- pyanaconda/storage/devices.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py index 14b0930..a125652 100644 --- a/pyanaconda/storage/devices.py +++ b/pyanaconda/storage/devices.py @@ -916,6 +916,7 @@ class StorageDevice(Device): raise DeviceError("cannot replace active format", self.name)
self._format = format + self._format.device = self.path
def _getFormat(self): return self._format
This reverts commit c8ffb16a0438c04d049823a36f76764c6fbace33. --- pyanaconda/storage/__init__.py | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index d5cbcf4..9904581 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -820,9 +820,7 @@ class Storage(object): else: name = "req%d" % self.nextID
- device = PartitionDevice(name, *args, **kwargs) - device.format.device = device.path - return device + return PartitionDevice(name, *args, **kwargs)
def newMDArray(self, *args, **kwargs): """ Return a new MDRaidArrayDevice instance for configuring. """ @@ -841,9 +839,7 @@ class Storage(object): else: name = "md%d" % kwargs["minor"]
- device = MDRaidArrayDevice(name, *args, **kwargs) - device.format.device = device.path - return device + return MDRaidArrayDevice(name, *args, **kwargs)
def newVG(self, *args, **kwargs): """ Return a new LVMVolumeGroupDevice instance. """ @@ -889,9 +885,7 @@ class Storage(object): if name in [d.name for d in self.devices]: raise ValueError("name already in use")
- device = LVMLogicalVolumeDevice(name, vg, *args, **kwargs) - device.format.device = device.path - return device + return LVMLogicalVolumeDevice(name, vg, *args, **kwargs)
def createDevice(self, device): """ Schedule creation of a device.
Related: rhbz#681037 --- pyanaconda/iw/lvm_dialog_gui.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/iw/lvm_dialog_gui.py b/pyanaconda/iw/lvm_dialog_gui.py index 1391524..cd76c9b 100644 --- a/pyanaconda/iw/lvm_dialog_gui.py +++ b/pyanaconda/iw/lvm_dialog_gui.py @@ -1159,6 +1159,7 @@ class VolumeGroupEditor:
format = self.luks[lv.lvname] if not format.exists: + actions.append(ActionDestroyFormat(usedev)) actions.append(ActionCreateFormat(usedev, format)) else: usedev = origlv
- ActionCreateFormat should not obsolete an ActionDestroyFormat that destroys an existing format. - ActionDestroyFormat should always destroy something, even if it's only a DeviceFormat instance. - ActionDestroyFormat on a non-existent format should not obsolete an ActionDestroyFormat on an existing format - Remove comment suggesting that ActionDestroyFormat is unnecessary. --- pyanaconda/storage/deviceaction.py | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/pyanaconda/storage/deviceaction.py b/pyanaconda/storage/deviceaction.py index 0f9503f..0a15499 100644 --- a/pyanaconda/storage/deviceaction.py +++ b/pyanaconda/storage/deviceaction.py @@ -456,18 +456,17 @@ class ActionCreateFormat(DeviceAction):
Format create actions obsolete the following actions:
- - format actions w/ lower id on this action's device + - format actions w/ lower id on this action's device, other + than those that destroy existing formats """ return (self.device.id == action.device.id and self.obj == action.obj and + not (action.isDestroy and action.format.exists) and self.id > action.id)
class ActionDestroyFormat(DeviceAction): - """ An action representing the removal of an existing filesystem. - - XXX this seems unnecessary - """ + """ An action representing the removal of an existing filesystem. """ type = ACTION_TYPE_DESTROY obj = ACTION_OBJECT_FORMAT
@@ -480,11 +479,10 @@ class ActionDestroyFormat(DeviceAction):
def execute(self, intf=None): """ wipe the filesystem signature from the device """ - if self.origFormat: - self.device.setup(orig=True) - self.origFormat.destroy() - udev_settle() - self.device.teardown() + self.device.setup(orig=True) + self.format.destroy() + udev_settle() + self.device.teardown()
def cancel(self): self.device.format = self.origFormat @@ -510,11 +508,15 @@ class ActionDestroyFormat(DeviceAction):
- format actions w/ lower id on same device, including self if format does not exist + + - format destroy action on a non-existent format shouldn't + obsolete a format destroy action on an existing one """ return (self.device.id == action.device.id and self.obj == self.obj and (self.id > action.id or - self.id == action.id and not self.device.exists)) + (self.id == action.id and not self.format.exists)) and + not (action.format.exists and not self.format.exists))
class ActionResizeFormat(DeviceAction):
anaconda-devel@lists.stg.fedoraproject.org