Re: [PATCH] Fix iscsi udev info parsing (#811426)

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

 



On Wed, Apr 11, 2012 at 10:53:07AM -0400, David Cantrell wrote:
> ---
>  storage/udev.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/storage/udev.py b/storage/udev.py
> index 7890c17..493c03e 100644
> --- a/storage/udev.py
> +++ b/storage/udev.py
> @@ -554,7 +554,7 @@ def udev_device_get_iscsi_port(info):
>      return path_components[address_field].split(":")[-1]
>  
>  def udev_device_get_iscsi_nic(info):
> -    session = info["sysfs_path"].split("/")[4]
> +    session = re.match('/.*/(session\d+)', info["sysfs_path"]).groups()[0]
>      iface = open("/sys/class/iscsi_session/%s/ifacename" %
>                   session).read().strip()
>      return iface
> -- 
> 1.7.1

Ack.

For regexes like this it might be useful to add an example string in a
comment.

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

Attachment: pgpLsRyinR47l.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