[blivet:rhel7/master 8/8] Cancel actions on empty devices (#1043763)

mulhern amulhern at redhat.com
Mon Feb 24 17:42:03 UTC 2014


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.

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):
-- 
1.8.3.1



More information about the anaconda-patches mailing list