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

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

 



> 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

Ugh, regular expressions.

In the case where re.match doesn't match anything, it'll return None in
which case we'll get a "NoneType has no attribute groups" here.

- Chris

_______________________________________________
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