File: //etc/leapp/repos.d/system_upgrade/common/libraries/persistentnetnames.pyc
�
��ic @ s] d d l Z d d l m Z d d l m Z m Z e j � Z d � Z d � Z d � Z
d S( i����N( t api( t Interfacet
PCIAddressc C sA t j t � j d � } g | D] } | j j d � s | ^ q S( sU
Returns a list of pyudev.Device objects for all physical network interfaces
t nets /devices/virtual/( t pyudevt
Enumeratort udev_contextt match_subsystemt device_patht
startswith( t
enumeratort d( ( s^ /usr/share/leapp-repository/repositories/system_upgrade/common/libraries/persistentnetnames.pyt physical_interfaces s c C s� i } | j d � r� | d d !j d � } | d | d <| d | d <| d j d
� d | d <| d j d
� d | d <n | S(
so
Returns PCI topology info from string which is expected to be a value of ID_PATH udev device property
s pci-i i t :i t domaini t busi t .t devicet function( R t split( t patht pcit
components( ( s^ /usr/share/leapp-repository/repositories/system_upgrade/common/libraries/persistentnetnames.pyt pci_info s c c s� x� t � D]� } i } y� | j | d <| j | d <| d | d <| d | d <t t | d � � | d <| j j d � | d
<t | d
t � r� | d
j � | d
<n Wn3 t
k
r� } t j � j
d t | � � q
n Xt | � Vq
Wd S(
s|
Generator which produces an Interface objects containing assorted interface properties relevant for network naming
t namet devpatht
ID_NET_DRIVERt drivert ID_VENDOR_IDt vendort ID_PATHR t addresst macs6 Failed to gather information about network interface: N( R t sys_nameR R R t
attributest gett
isinstancet bytest decodet ExceptionR t current_loggert warningt strR ( t devt attrst e( ( s^ /usr/share/leapp-repository/repositories/system_upgrade/common/libraries/persistentnetnames.pyt
interfaces"