[PATCH 3/6] Don't check for disklabels on partitions.
David Lehman
dlehman at redhat.com
Fri May 2 17:03:40 UTC 2014
Udev puts the ID_PART_TABLE_TYPE from the disk into the entries for its
partitions, so we have to ignore it for partitions. Also, whether or not
there is a disklabel has nothing to do with whether or not udev has
reported other formatting on that device.
---
blivet/devicetree.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 1a664a6..26d9a4d 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1206,11 +1206,16 @@ class DeviceTree(object):
device.deviceLinks = udev.udev_device_get_symlinks(info)
def handleUdevDiskLabelFormat(self, info, device):
- disklabel_type = info.get("ID_PART_TABLE_TYPE")
+ if isinstance(device, PartitionDevice):
+ # udev puts the ID_PART_TABLE_TYPE for the disk in the entry for
+ # each of the partitions
+ disklabel_type = None
+ else:
+ disklabel_type = info.get("ID_PART_TABLE_TYPE")
+
log_method_call(self, device=device.name, label_type=disklabel_type)
# if there is no disklabel on the device
- if disklabel_type is None and \
- getFormat(udev.udev_device_get_format(info)).type is not None:
+ if disklabel_type is None:
log.debug("device %s does not contain a disklabel", device.name)
return
--
1.9.0
More information about the anaconda-patches
mailing list