[blivet:rhel7/master 8/8] Cancel actions on empty devices (#1043763)
David Lehman
dlehman at redhat.com
Mon Feb 24 17:59:37 UTC 2014
On Mon, 2014-02-24 at 12:42 -0500, mulhern wrote:
> Related: rhbz#1043763
>
> If a device is actually empty, cancel the action on the device in order
> to undo state changes on that device. Do not remove the action.
I can't help but think that this patch is glossing over some other
problem that should be addressed instead of pursuing this solution. If
all of the device create actions on a disk have been canceled, the
disk's free space should be (more or less) equal to its size.
David
>
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
> blivet/devicetree.py | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> index 788a22f..0d620f3 100644
> --- a/blivet/devicetree.py
> +++ b/blivet/devicetree.py
> @@ -1860,6 +1860,11 @@ class DeviceTree(object):
> for d in dependents:
> hide_device(d)
>
> + empty_devices = [ d for d in self._devices if self.emptyDevice(d) ]
> + cancel_actions = [ a for a in self._actions if a.device in empty_devices ]
> + for a in cancel_actions:
> + a.cancel()
> +
> def unhide(self, device):
> # the hidden list should be in leaves-first order
> for hidden in reversed(self._hidden):
More information about the anaconda-patches
mailing list