Check before setting partition label (#729599)
On Fri, 2011-08-12 at 09:54 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl@redhat.com>
>
> Not all disk labels (eg. msdos) support names on partitions, so
> you have to check before trying to set it.
Ack.
> ---
> pyanaconda/storage/__init__.py | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
> index 33f7e96..c1c1fea 100644
> --- a/pyanaconda/storage/__init__.py
> +++ b/pyanaconda/storage/__init__.py
> @@ -413,9 +413,10 @@ class Storage(object):
> log.info("setting boot flag on %s" % dev.name)
> dev.bootable = True
>
> - # Set the boot partition's name
> - ped_partition = dev.partedPartition.getPedPartition()
> - ped_partition.set_name(dev.format.name)
> + # Set the boot partition's name on disk labels that support it
> + if dev.partedPartition.disk.supportsFeature(parted.DI SK_TYPE_PARTITION_NAME):
> + ped_partition = dev.partedPartition.getPedPartition()
> + ped_partition.set_name(dev.format.name)
>
> dev.disk.setup()
> dev.disk.format.commitToDisk()
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
|