Related: rhbz#1043763
Removing actions has side effects which can potentially change dependencies.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devicetree.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index ffbe72e..fa4aada 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1820,10 +1820,8 @@ class DeviceTree(object):
"""Cancel all actions relating to a single device and remove
them
from the action list.
"""
- for action in reversed(self._actions):
- if not action.device.dependsOn(device) and action.device != device:
- continue
-
+ cancels = [ a for a in reversed(self._actions) if a.device.dependsOn(device)
or a.device == device ]
+ for action in cancels:
log.debug("cancelling action: %s" % action)
try:
action.cancel()
--
1.8.3.1