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

David Shea dshea at redhat.com
Sun Mar 30 15:17:13 UTC 2014


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=.


More information about the anaconda-patches mailing list