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

[PATCH 1/2] Ignore probably-spurious disklabels on unpartitionable devices. (#567832)



---
 storage/devicetree.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 386d23f..e0892d9 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1303,7 +1303,11 @@ class DeviceTree(object):
             except InvalidDiskLabelError:
                 pass
             else:
-                device.format = format
+                if format.partitions:
+                    # parted's checks for disklabel presence are less than
+                    # rigorous, so we will assume that detected disklabels
+                    # with no partitions are spurious
+                    device.format = format
             return
 
         # if the disk contains protected partitions we will not wipe the
-- 
1.6.6


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