[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Check if we'll clear a partition after setting its format attr. (#499251)



---
 storage/devicetree.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index e6c0614..3837b45 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1176,9 +1176,7 @@ class DeviceTree(object):
                 device = self.addUdevPartitionDevice(info)
 
         # now handle the device's formatting
-        if not shouldClear(device, self.clearPartType, self.clearPartDisks,
-                           self.protectedPartitions):
-            self.handleUdevDeviceFormat(info, device)
+        self.handleUdevDeviceFormat(info, device)
 
     def handleUdevLUKSFormat(self, info, device):
         log_method_call(self, name=device.name, type=device.format.type)
@@ -1506,6 +1504,12 @@ class DeviceTree(object):
             device.format = None
             return
 
+        if shouldClear(device, self.clearPartType, self.clearPartDisks,
+                       self.protectedPartitions):
+            # if this is a partition that will be cleared by clearpart,
+            # don't bother with format-specific processing
+            return
+
         #
         # now do any special handling required for the device's format
         #
-- 
1.6.0.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]