1 $-ˆl–ß=¿J µ2ÛR‚œP-\l˜´o „ l„ÁÀÉ;Î-a '¡DgŸbã@sîddlZddlZddlZddlZddlZddlZddlmZmZddl m Z m Z ddl m Z mZmZmZddlmZddlmZdZdZd Zd Ze e¡ZGd d „d ƒZGd d„dejƒZddd„Zddd„Zdd„Z ddd„Z!ddd„Z"dS)éN)ÚListÚOptional)ÚsubpÚutil)Úis_ipv6_addressÚis_ipv6_networkÚrendererÚsubnet_is_ipv6)Ú NetworkState)Úavailable_nm_ifcfg_rhz/etc/NetworkManagerz/usr/lib/NetworkManagerz/etc/sysconfig/network-scriptszÞ# This is generated by cloud-init. Do not edit. # [.config] enable=nm-version-min:1.40 [connection.30-cloud-init-ip6-addr-gen-mode] # Select EUI64 to be used if the profile does not specify it. ipv6.addr-gen-mode=0 c@sÎeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z e dœdd„Z dd„Z dd„Zdd„Zdd„Zdd„Ze ddœdd „Zee dd!œd"d#„Zd$d%„Zd&d'„Zed(d)„ƒZd*d+„Zd,d-„ZdS).Ú NMConnectionz/Represents a NetworkManager connection profile.cCsRt d¡}t ¡|_t|j_d|›�tt ||¡ƒddœ|jd<ddi|jd<d S) z‘ Initializes the connection with some very basic properties, notably the UUID so that the connection can be referred to. z$a3924cb8-09e0-43e9-890b-77972a800108z cloud-init Z120)ÚidÚuuidzautoconnect-priorityÚ connectionz%org.freedesktop.NetworkManager.originz cloud-initÚuserN)rZUUIDÚ configparserZ ConfigParserÚconfigÚstrZ optionxformZuuid5)ÚselfÚcon_idZ CI_NM_UUID©rúA/usr/lib/python3.9/site-packages/cloudinit/net/network_manager.pyÚ__init__-s  ý ÿzNMConnection.__init__cCs6|j |¡si|j|<|j ||¡s2||j||<dS)z_ Sets a property unless it's already set, ensuring the section exists. N©rÚ has_sectionÚ has_option©rÚsectionÚoptionÚvaluerrrÚ _set_defaultEs  zNMConnection._set_defaultcCs|j |¡o|j ||¡S)zf Checks if a config option is set. Returns True if it is, else returns False. r©rrrrrrÚ_config_option_is_setPsÿz"NMConnection._config_option_is_setcCs"| ||¡r|j||SdSdS)z] Returns the value of a config option if its set, else returns None. N©r"rr!rrrÚ_get_config_optionYs zNMConnection._get_config_optioncCs| ||¡r||j||<dS)zŒ Overrides the value of a config option if its already set. Else, if the config option is not set, it does nothing. Nr#rrrrÚ_change_set_config_optioncs z&NMConnection._change_set_config_optioncCsRdD]0}| |d¡dkrdS| |d¡dvrdSqdD]}| |dd¡q:dS)zt If for both ipv4 and ipv6, 'may-fail' is set to be False, set it to True for both of them. ©Úipv4Úipv6úmay-failÚfalseNÚmethod)ÚdhcpÚautoÚtrue)r$r%)rÚfamilyrrrÚ$_set_mayfail_true_if_both_false_dhcpksz1NMConnection._set_mayfail_true_if_both_false_dhcpc CsÈdddddddddœ}d}| |d|¡z|r6||}Wn$ty\d}d|j|d<Yn0|j|ddkrtd S|j|ddkr’|dkr’d S|d vr¨| d dd¡||j|d<| |dd ¡d S) z} Ensures there's appropriate [ipv4]/[ipv6] for given family appropriate for given configuration type Zmanualr-r,)ZstaticZstatic6Zdhcp6Ú ipv6_slaacúipv6_dhcpv6-statelessúipv6_dhcpv6-statefulZdhcp4r,Údisabledr+r.r)N)r3r2r1r'r*)r ÚKeyErrorr)rr/Z subnet_typeZ method_mapr+rrrÚ_set_ip_methodƒs2ø   zNMConnection._set_ip_method)ÚreturncC