[PATCH 2/2] Explicitly requested extended partitions already have an action.

David Lehman dlehman at redhat.com
Fri May 2 17:48:41 UTC 2014


When an extended partition is created as a side-effect of partition
allocation, it does not have an action associated with its creation,
so we instantiate that action just before processing the actions. This
is not necessary for extended partitions explicitly requested.
---
 blivet/devicetree.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index bc5a27a..ef21339 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -258,13 +258,17 @@ class DeviceTree(object):
 
         # setup actions to create any extended partitions we added
         #
+        # If the extended partition was explicitly requested it will already
+        # have an action registered.
+        #
         # XXX At this point there can be duplicate partition paths in the
         #     tree (eg: non-existent sda6 and previous sda6 that will become
         #     sda5 in the course of partitioning), so we access the list
         #     directly here.
         for device in self._devices:
             if isinstance(device, PartitionDevice) and \
-               device.isExtended and not device.exists:
+               device.isExtended and not device.exists and \
+               not self.findActions(device=device, type="create"):
                 # don't properly register the action since the device is
                 # already in the tree
                 action = ActionCreateDevice(device)
-- 
1.9.0



More information about the anaconda-patches mailing list