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

Re: [PATCH] Use a different method to get the sysfs_path for device-mapper devices (#665643).



On Tue, 2011-01-04 at 15:51 -0500, Chris Lumens wrote:
> ---
>  pyanaconda/storage/formats/__init__.py |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/pyanaconda/storage/formats/__init__.py b/pyanaconda/storage/formats/__init__.py
> index f5377c6..6c71042 100644
> --- a/pyanaconda/storage/formats/__init__.py
> +++ b/pyanaconda/storage/formats/__init__.py
> @@ -396,7 +396,15 @@ class DeviceFormat(object):
>      @property
>      def majorminor(self):
>          """A string suitable for using as a pseudo-unique ID in kickstart."""
> -        sysfs_path = get_sysfs_path_by_name(self.device)
> +
> +        # If this is a device-mapper device, we have to get the DM node and
> +        # build the sysfs path from that.
> +        try:
> +            device = dm_node_from_name(self.device)

Since self.device is a full path this will never work -- just pass
self.device's basename.

> +        except:
> +            device = self.device

You can just catch DMError here.

> +
> +        sysfs_path = get_sysfs_path_by_name(device)
>          dev = udev_get_device(sysfs_path[4:])
>          return "%03d%03d" % (udev_device_get_major(dev), udev_device_get_minor(dev))
>  



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