[PATCH rhel6-branch] fcoe: keep former nic detection for netxtreme2 drivers (#1008731)

Brian C. Lane bcl at redhat.com
Fri Oct 4 16:30:38 UTC 2013


On Fri, Oct 04, 2013 at 03:26:33PM +0200, Radek Vykydal wrote:
> +        if os.access('/sys/%s/%s/fc_host' %(sysfs_pci, host), os.X_OK) and \
> +                os.access('/sys/%s/net' %(sysfs_pci), os.X_OK):

One space after the % makes it slightly more readable.

>  
> +    (sysfs_pci, host) = _detect_broadcom_fcoe_netxtreme2(info)
> +    if (sysfs_pci, host) != (None, None):
> +        net_path = '/sys/%s/net' % sysfs_pci
> +        listdir = os.listdir(net_path)
> +        if len(listdir) > 0 :
> +            return listdir[0]

According to the docs listdir's output is 'The list is in arbitrary
order.' so you probably want to sort it before picking element 0.

Looks good other than that.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20131004/712369db/attachment-0001.sig>


More information about the anaconda-patches mailing list