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

[PATCH] Ignore spurious formatting on partitioned devices.



If the device contains a valid partition table we do not care what else
udev tells us is there.

Once we move to optionally partitioned devices, this may no longer be
adequate logic for this type of problem.
---
 storage/devicetree.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 318d588..1451623 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1493,6 +1493,14 @@ class DeviceTree(object):
             device.format = formats.DeviceFormat()
             return
 
+        if getattr(device, "partedDisk", None):
+            # Any detected formatting is spurious. Ignore it.
+            # We don't want to try to remove it since that could wipe out
+            # valid data like the partition table or data in existing
+            # partitions.
+            device.format = None
+            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]