Re: [PATCH 2/4] Prevent /sys/class/block/mapper!vg*-lv* lookups.

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

 



On Tue, Apr 19, 2011 at 01:05:57PM -1000, David Cantrell wrote:
> I was hitting this today.  The /dev/mapper/vg*-lv* names were getting
> translated to /sys/class/block/mapper!vg*-lv*.
> ---
>  pyanaconda/iutil.py |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
> index a004ae0..00567d7 100644
> --- a/pyanaconda/iutil.py
> +++ b/pyanaconda/iutil.py
> @@ -806,9 +806,7 @@ def get_sysfs_path_by_name(dev_node, class_name="block"):
>          (e.g. /sys/class/block/vda2). This also has to work for device nodes
>          that are in a subdirectory of /dev like '/dev/cciss/c0d0p1'.
>       """
> -    dev_name = os.path.basename(dev_node)
> -    if dev_node.startswith("/dev/"):
> -        dev_name = dev_node[5:].replace("/", "!")
> +    dev_name = os.path.basename(os.path.realpath(dev_node)).replace("/", "!")

Is the .replace still useful for anything? basename is going to return
the last part of the path and will never have a / in it.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)

Attachment: pgpTi0Re9UxJ8.pgp
Description: PGP signature

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux