[PATCH 3/6] Don't check for disklabels on partitions.
Anne Mulhern
amulhern at redhat.com
Fri May 2 21:33:59 UTC 2014
----- Original Message -----
> From: "David Lehman" <dlehman at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, May 2, 2014 1:03:40 PM
> Subject: [PATCH 3/6] Don't check for disklabels on partitions.
>
> 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
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
Is there any way to put this functionality in udev.py instead?
There is a udev_device_is_partition() method.
- mulhern
More information about the anaconda-patches
mailing list