/usr/lib/python3.6/site-packages/cloudinit/distros/__pycache__
NameSizeModeActions
almalinux.cpython-36.opt-1.pyc3130644editdlrm
almalinux.cpython-36.pyc3130644editdlrm
alpine.cpython-36.opt-1.pyc69470644editdlrm
alpine.cpython-36.pyc69470644editdlrm
amazon.cpython-36.opt-1.pyc4500644editdlrm
amazon.cpython-36.pyc4500644editdlrm
arch.cpython-36.opt-1.pyc75090644editdlrm
arch.cpython-36.pyc75090644editdlrm
bsd.cpython-36.opt-1.pyc49910644editdlrm
bsd.cpython-36.pyc49910644editdlrm
bsd_utils.cpython-36.opt-1.pyc11180644editdlrm
bsd_utils.cpython-36.pyc11180644editdlrm
centos.cpython-36.opt-1.pyc3100644editdlrm
centos.cpython-36.pyc3100644editdlrm
cloudlinux.cpython-36.opt-1.pyc3140644editdlrm
cloudlinux.cpython-36.pyc3140644editdlrm
cos.cpython-36.opt-1.pyc3090644editdlrm
cos.cpython-36.pyc3090644editdlrm
debian.cpython-36.opt-1.pyc76980644editdlrm
debian.cpython-36.pyc76980644editdlrm
dragonflybsd.cpython-36.opt-1.pyc3610644editdlrm
dragonflybsd.cpython-36.pyc3610644editdlrm
eurolinux.cpython-36.opt-1.pyc3130644editdlrm
eurolinux.cpython-36.pyc3130644editdlrm
fedora.cpython-36.opt-1.pyc3100644editdlrm
fedora.cpython-36.pyc3100644editdlrm
freebsd.cpython-36.opt-1.pyc63590644editdlrm
freebsd.cpython-36.pyc63590644editdlrm
gentoo.cpython-36.opt-1.pyc70720644editdlrm
gentoo.cpython-36.pyc70720644editdlrm
mariner.cpython-36.opt-1.pyc15760644editdlrm
mariner.cpython-36.pyc15760644editdlrm
miraclelinux.cpython-36.opt-1.pyc3160644editdlrm
miraclelinux.cpython-36.pyc3160644editdlrm
netbsd.cpython-36.opt-1.pyc46880644editdlrm
netbsd.cpython-36.pyc46880644editdlrm
networking.cpython-36.opt-1.pyc125060644editdlrm
networking.cpython-36.pyc125060644editdlrm
net_util.cpython-36.opt-1.pyc18890644editdlrm
net_util.cpython-36.pyc18890644editdlrm
openbsd.cpython-36.opt-1.pyc23130644editdlrm
openbsd.cpython-36.pyc23130644editdlrm
OpenCloudOS.cpython-36.opt-1.pyc5420644editdlrm
OpenCloudOS.cpython-36.pyc5420644editdlrm
openeuler.cpython-36.opt-1.pyc5380644editdlrm
openeuler.cpython-36.pyc5380644editdlrm
openmandriva.cpython-36.opt-1.pyc3180644editdlrm
openmandriva.cpython-36.pyc3180644editdlrm
opensuse-leap.cpython-36.opt-1.pyc3210644editdlrm
opensuse-leap.cpython-36.pyc3210644editdlrm
opensuse-microos.cpython-36.opt-1.pyc3240644editdlrm
opensuse-microos.cpython-36.pyc3240644editdlrm
opensuse-tumbleweed.cpython-36.opt-1.pyc3270644editdlrm
opensuse-tumbleweed.cpython-36.pyc3270644editdlrm
opensuse.cpython-36.opt-1.pyc64290644editdlrm
opensuse.cpython-36.pyc64290644editdlrm
photon.cpython-36.opt-1.pyc44160644editdlrm
photon.cpython-36.pyc44160644editdlrm
rhel.cpython-36.opt-1.pyc49320644editdlrm
rhel.cpython-36.pyc49320644editdlrm
rhel_util.cpython-36.opt-1.pyc9690644editdlrm
rhel_util.cpython-36.pyc9690644editdlrm
rocky.cpython-36.opt-1.pyc3090644editdlrm
rocky.cpython-36.pyc3090644editdlrm
sle-micro.cpython-36.opt-1.pyc3170644editdlrm
sle-micro.cpython-36.pyc3170644editdlrm
sles.cpython-36.opt-1.pyc3120644editdlrm
sles.cpython-36.pyc3120644editdlrm
sle_hpc.cpython-36.opt-1.pyc3150644editdlrm
sle_hpc.cpython-36.pyc3150644editdlrm
suse.cpython-36.opt-1.pyc3120644editdlrm
suse.cpython-36.pyc3120644editdlrm
TencentOS.cpython-36.opt-1.pyc5400644editdlrm
TencentOS.cpython-36.pyc5400644editdlrm
ubuntu.cpython-36.opt-1.pyc14840644editdlrm
ubuntu.cpython-36.pyc14840644editdlrm
ug_util.cpython-36.opt-1.pyc40040644editdlrm
ug_util.cpython-36.pyc40040644editdlrm
virtuozzo.cpython-36.opt-1.pyc3130644editdlrm
virtuozzo.cpython-36.pyc3130644editdlrm
__init__.cpython-36.opt-1.pyc364580644editdlrm
__init__.cpython-36.pyc364580644editdlrm
Edit: /usr/lib/python3.6/site-packages/cloudinit/distros/__pycache__/networking.cpython-36.pyc (12506B)
3 \me+@sddlZddlZddlZddlmZmZmZddlmZej e Z e Z eZGdddejdZGdddeZGd d d eZGd d d eZdS) N)netsubputil)ifconfigc@seZdZdZedddZddedddd Zej e dd d d Z e d ddZ e d ddZe ed ddZddZddedddZedddZedddZe eddd Ze d d!d"Zedd#d$Zedd%d&Ze d d'd(Zdd)e eed*d+d,Ze ed-d.d/Ze ed-d0d1Zej e ed-d2d3Ze ed-d4d5Ze ed-d6d7Ze ed-d8d9Z e ed-d:d;Z!ej dd<ddd=d>Z"d?d)e edd@dAdBZ#ej e ed-dCdDZ$dS)E NetworkingaThe root of the Networking hierarchy in cloud-init. This is part of an ongoing refactor in the cloud-init codebase, for more details see "``cloudinit.net`` -> ``cloudinit.distros.networking`` Hierarchy" in CONTRIBUTING.rst for full details. )returncCstjS)N)r_get_current_rename_info)selfr /usr/lib/python3.6/networking.pyrsz#Networking._get_current_rename_infoN) current_info)renamesrcCstj||dS)N)r )r_rename_interfaces)r r r r r r rszNetworking._rename_interfaces)netcfgrcCsdS)z7Read the network config and rename devices accordingly.Nr )r rr r r apply_network_config_namessz%Networking.apply_network_config_names)devnamecCs tj|S)N)r device_devid)r rr r r r#szNetworking.device_devidcCs tj|S)N)r device_driver)r rr r r r&szNetworking.device_drivercCs tj|S)N)rextract_physdevs)r rr r r r)szNetworking.extract_physdevscCstjS)N)rfind_fallback_nic)r r r r r,szNetworking.find_fallback_nicF) config_drivercCs tj|dS)N)r)rgenerate_fallback_config)r rr r r r/sz#Networking.generate_fallback_configcCstjS)N)rget_devicelist)r r r r r2szNetworking.get_devicelistcCstjS)N)rget_ib_hwaddrs_by_interface)r r r r r5sz&Networking.get_ib_hwaddrs_by_interface)rethernet_formatcCs tj||S)N)rget_ib_interface_hwaddr)r rrr r r r8sz"Networking.get_ib_interface_hwaddrcCs tj|S)N)rget_interface_mac)r rr r r r=szNetworking.get_interface_maccCstjS)N)rget_interfaces)r r r r r@szNetworking.get_interfacescCstjS)N)rget_interfaces_by_mac)r r r r rCsz Networking.get_interfaces_by_maccCs tj|S)N)r get_master)r rr r r rFszNetworking.get_master)strict)rr rcCstj||dS)N)r )rinterface_has_own_mac)r rr r r r r!Isz Networking.interface_has_own_mac)rrcCs tj|S)N)ris_bond)r rr r r r"NszNetworking.is_bondcCs tj|S)N)r is_bridge)r rr r r r#QszNetworking.is_bridgecCsdS)z Is ``devname`` a physical network device? Examples of non-physical network devices: bonds, bridges, tunnels, loopback devices. Nr )r rr r r is_physicalTszNetworking.is_physicalcCs tj|S)N)r is_renamed)r rr r r r%]szNetworking.is_renamedcCs tj|S)N)ris_up)r rr r r r&`szNetworking.is_upcCs tj|S)N)ris_vlan)r rr r r r'cszNetworking.is_vlancCs tj|S)N)rmaster_is_bridge_or_bond)r rr r r r(fsz#Networking.master_is_bridge_or_bond)existscCsdS)aWait for device population in the system to complete. :param exists: An optional optimisation. If given, only perform as much of the settle process as is required for the given DeviceName to be present in the system. (This may include skipping the settle process entirely, if the device already exists.) :type exists: Optional[DeviceName] Nr )r r)r r r settleiszNetworking.settleT)rr rc Cs|j|}tdd|D}t|j}|jj}xtddD]x}|j|r\tjddS|j |}tjd|x8|D]0} || } dj | } t j tj| |j d | id qxW|jj}q@Wd |} tj| |rt| dS) aWait for all the physical devices in `netcfg` to exist on the system Specifically, this will call `self.settle` 5 times, and check after each one if the physical devices are now present in the system. :param netcfg: The NetworkConfig from which to extract physical devices to wait for. :param strict: Raise a `RuntimeError` if any physical devices are not present after waiting. cSsg|]}|d|dfqS)rr ).0Zifacer r r sz0Networking.wait_for_physdevs..rz*net: all expected physical devices presentNz)net: waiting for expected net devices: %szWaiting for settle or {} existsr))funckwargsz-Not all expected physical devices present: %s)rdictsetkeysrrangeissubsetLOGdebug differenceformatrZlog_timer*Zwarning RuntimeError) r rr ZphysdevsZexpected_ifacesZ expected_macsZ present_macs_ZmissingZmacrmsgr r r wait_for_physdevsus.          zNetworking.wait_for_physdevscCsdS)z=Try setting the link to up explicitly and return if it is up.Nr )r rr r r try_set_link_upszNetworking.try_set_link_up)%__name__ __module__ __qualname____doc__r1rlistrabcabstractmethod NetworkConfigr DeviceNamerrrrboolrrrrrrrrr!r"r#r$r%r&r'r(r*r=r>r r r r rsB  4r) metaclasscseZdZdZfddZddZedddd Zee d d d Z ee d d dZ ee d ddZ ee d ddZ ee d ddZddddddZee d ddZZS) BSDNetworkingz>Implementation of networking functionality shared across BSDs.cs&tj|_i|_|jtjdS)N)rZIfconfigifcifs _update_ifssuper__init__)r ) __class__r r rOs zBSDNetworking.__init__cCs,tjddg}|dr(|jj|d|_dS)Nrz-ar)rrKparserL)r Zifconfr r r rMszBSDNetworking._update_ifsN)rrcCstjddS)Nz Cannot rename network interface.)r6r7)r rr r r rsz(BSDNetworking.apply_network_config_names)rrcCs |j|jS)N)rLr$)r rr r r r$szBSDNetworking.is_physicalcCs |j|jS)N)rLr")r rr r r r"szBSDNetworking.is_bondcCs |j|jS)N)rLr#)r rr r r r#szBSDNetworking.is_bridgecCs |j|jS)N)rLr')r rr r r r'szBSDNetworking.is_vlancCs |j|jS)N)rLup)r rr r r r&szBSDNetworking.is_up)r))rcCsdS)z0BSD has no equivalent to `udevadm settle`; noop.Nr )r r)r r r r*szBSDNetworking.settlecCstjd|dg|j|S)zTry setting the link to up explicitly and return if it is up. Not guaranteed to bring the interface up. The caller is expected to add wait times before retrying.rrR)rr&)r rr r r r>szBSDNetworking.try_set_link_up)r?r@rArBrOrMrFrrGrHr$r"r#r'r&r*r> __classcell__r r )rPr rJs rJc@s,eZdZeddddZeedddZdS)FreeBSDNetworkingN)rrcCsdS)Nr )r rr r r rsz,FreeBSDNetworking.apply_network_config_names)rrcCsB|j|jsdStjdd|gddgd\}}|dj|kr>dSdS) NFZdevinfoz-prr+)rcszdevinfo: {}: Not found T)rLr$rr9)r rr;errr r r r%s  zFreeBSDNetworking.is_renamed)r?r@rArFrrGrHr%r r r r rTsrTc@seZdZdZeddddZeedddZee dd d Z ee dd d Z ee dd dZ ee dddZ ee dddZee dddZddddddZee dddZdS)LinuxNetworkingzCImplementation of networking functionality common to Linux distros.N)rrcCsJy|j|j|Wn0tk rD}ztd||WYdd}~XnXdS)zRead the network config and rename devices accordingly. Renames are only attempted for interfaces of type 'physical'. It is expected that the network system will create other devices with the correct name in place. z(Failed to apply network config names: %sN)rrr:)r rer r r rs z*LinuxNetworking.apply_network_config_names)rrcCs tj|S)N)rget_dev_features)r rr r r rYsz LinuxNetworking.get_dev_featurescCs tj|S)N)rhas_netfail_standby_feature)r rr r r rZsz+LinuxNetworking.has_netfail_standby_featurecCs tj|S)N)ris_netfailover)r rr r r r[szLinuxNetworking.is_netfailovercCs tj|S)N)ris_netfail_master)r rr r r r\sz!LinuxNetworking.is_netfail_mastercCs tj|S)N)ris_netfail_primary)r rr r r r]sz"LinuxNetworking.is_netfail_primarycCs tj|S)N)ris_netfail_standby)r rr r r r^sz"LinuxNetworking.is_netfail_standbycCstjjtj|dS)NZdevice)ospathr)r sys_dev_path)r rr r r r$"szLinuxNetworking.is_physical)r))rcCs"|dk rtj|}tj|ddS)N)r))rrarZudevadm_settle)r r)r r r r*%s zLinuxNetworking.settlecCstjddd|dg|j|S)zTry setting the link to up explicitly and return if it is up. Not guaranteed to bring the interface up. The caller is expected to add wait times before retrying.Ziplinkr2rR)rr&)r rr r r r>*szLinuxNetworking.try_set_link_up)r?r@rArBrFrrGstrrYrHrZr[r\r]r^r$r*r>r r r r rWsrW)rDZloggingr_Z cloudinitrrrZcloudinit.distros.parsersrZ getLoggerr?r6rcrGr1rFABCMetarrJrTrWr r r r s   -!