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 11:06:59AM -0400, Chris Lumens wrote:
> > 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.

Yeah, that's true.  I think this is still an in-progress thing.

-- 
David Cantrell <dcantrell@xxxxxxxxxx>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT

_______________________________________________
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