[blivet:master 14/14] Rearrange _startEdd to be a little more obvious.

Anne Mulhern amulhern at redhat.com
Mon Mar 31 19:18:40 UTC 2014





----- Original Message -----
> From: "David Shea" <dshea at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Sunday, March 30, 2014 11:17:13 AM
> Subject: Re: [blivet:master 14/14] Rearrange _startEdd to be a little more	obvious.
> 
> On 03/28/2014 06:50 PM, mulhern wrote:
> > This change was prompted by an unused variable warning.
> >
> > The method should behave identically, except for the unlikely
> > scenario where rc is "NIC=", in which case the previous version
> > would raise a ValueError, and the new version logs an error.
> > ---
> >   blivet/fcoe.py | 8 ++------
> >   1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/blivet/fcoe.py b/blivet/fcoe.py
> > index 62b047a..d4cad3b 100644
> > --- a/blivet/fcoe.py
> > +++ b/blivet/fcoe.py
> > @@ -73,15 +73,11 @@ class fcoe(object):
> >           except OSError as e:
> >               rc = e.strerror
> >   
> > -        if not rc.startswith("NIC="):
> > +        (key, _equals, val) = rc.strip().partition("=")
> > +        if not val or key != "NIC":
> >               log.info("No FCoE EDD info found: %s", rc.rstrip())
> >               return
> >   
> > -        (key, val) = rc.strip().split("=", 1)
> > -        #if val not in isys.getDeviceProperties():
> > -        #    log.error("Unknown FCoE NIC found in EDD: %s, ignoring", val)
> > -        #    return
> > -
> >           log.info("FCoE NIC found in EDD: %s", val)
> >           self.addSan(val, dcb=True, auto_vlan=True)
> >   
> 
> Can you return in except OSError branch instead of setting rc? It seems
> kind of silly to scan the strerror output for NIC=.
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

Pretty silly, indeed. Logging the problem and then returning in except clause.

- mulhern


More information about the anaconda-patches mailing list