+
    ib                     "   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RI	H
t
Ht ^ RIHtHtHtHt ^ RIHt ^ RIHt RtRtR	tR
t]P2                  ! ]4      t ! R R4      t ! R R]P:                  4      tRR ltRR ltR t RR lt!R t"R# )    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                      a  ] tR t^*t o RtR tR tR tR tR t	R t
R tV 3R	 lR
 ltR tR tR tR tR tV 3R lR ltV 3R lR ltR tR t]R 4       tR tR tRtV tR# )NMConnectionz/Represents a NetworkManager connection profile.c           	        \         P                  ! R4      p\        P                  ! 4       V n        \
        V P                  n        RRV 2R\        \         P                  ! W!4      4      RR/V P                  R&   RR	/V P                  R
&   R# )zy
Initializes the connection with some very basic properties,
notably the UUID so that the connection can be referred to.
z$a3924cb8-09e0-43e9-890b-77972a800108idzcloud-init uuidzautoconnect-priority120
connectionz%org.freedesktop.NetworkManager.originz
cloud-inituserN)r   UUIDconfigparserConfigParserconfigstroptionxformuuid5)selfcon_id
CI_NM_UUIDs   && ?/usr/lib/python3/dist-packages/cloudinit/net/network_manager.py__init__NMConnection.__init__-   s|     YYEF
"//1"% Kx(C

:67"E%
L! 4\
F    c                    V P                   P                  V4      '       g   / V P                   V&   V P                   P                  W4      '       g   W0P                   V,          V&   R# R# )zG
Sets a property unless it's already set, ensuring the section
exists.
Nr   has_section
has_optionr   sectionoptionvalues   &&&&r   _set_defaultNMConnection._set_defaultE   sR     {{&&w//#%DKK {{%%g66+0KK ( 7r"   c                ~    V P                   P                  V4      ;'       d    V P                   P                  W4      # )zN
Checks if a config option is set. Returns True if it is,
else returns False.
r$   r   r(   r)   s   &&&r   _config_option_is_set"NMConnection._config_option_is_setP   s9    
 {{&&w/ 
 
DKK4J4J5
 	
r"   c                h    V P                  W4      '       d   V P                  V,          V,          # R# )zE
Returns the value of a config option if its set,
else returns None.
Nr/   r   r.   s   &&&r   _get_config_optionNMConnection._get_config_optionY   s,    
 %%g66;;w'//r"   c                b    V P                  W4      '       d   W0P                  V,          V&   R# R# )zt
Overrides the value of a config option if its already set.
Else, if the config option is not set, it does nothing.
Nr2   r'   s   &&&&r   _change_set_config_option&NMConnection._change_set_config_optionc   s+    
 %%g66+0KK ( 7r"   c                    R F7  pV P                  VR4      R8w  d    R# V P                  VR4      R9  g   K6   R# 	  R F  pV P                  VRR4       K  	  R# )z\
If for both ipv4 and ipv6, 'may-fail' is set to be False,
set it to True for both of them.
may-failfalseNmethodtrueipv4ipv6)dhcpauto)r3   r6   )r   familys   & r   $_set_mayfail_true_if_both_false_dhcp1NMConnection._set_mayfail_true_if_both_false_dhcpk   sf    
 'F&&vz:gE &&vx8 A 
  '  'F**6:vF 'r"   c                   RRRRRRRRRRRR	R
RR	R/pRpV P                  VRV4        V'       d	   W2,          pT P                  T,          R,          R	8X  d   R# T P                  T,          R,          R8X  d
   TR8X  d   R# TR9   d   T P                  RRR4       Y@P                  T,          R&   T P                  TRR4       R#   \         d    RpRT P                  T,          R&    Li ; i)ze
Ensures there's appropriate [ipv4]/[ipv6] for given family
appropriate for given configuration type
staticmanualstatic6dhcp6rA   
ipv6_slaacipv6_dhcpv6-statelessipv6_dhcpv6-statefulr@   dhcp4disabledr;   r<   r9   Nr>   r:   )rL   rK   rJ   )r+   KeyErrorr   )r   rB   subnet_type
method_mapr;   s   &&&  r   _set_ip_methodNMConnection._set_ip_method   s    hxV&#V"FVF	

 &(F3	5#0 ;;vx(F2;;vx(F2v7I 
 
 fh
;(.FH% 	&*g6G  	5F.4DKK
+	5s   C C #C,+C,c                    < V ^8  d   QhRS[ /# )   returnr   )format__classdict__s   "r   __annotate__NMConnection.__annotate__   s       r"   c                    V P                   P                  V4      '       g   / V P                   V&   \        P                  ! ^4       F.  pV V 2pV P                   P	                  W4      '       d   K,  Vu # 	  R# )   not_possible)r   r%   	itertoolscountr&   )r   r(   
key_prefixindexkeys   &&&  r   _get_next_numbered_section'NMConnection._get_next_numbered_section   se    {{&&w//#%DKK __Q'EL(C;;))'77
 ( r"   c                R    V P                  W4      pW0P                  V,          V&   R# )zm
Adds a numbered property, such as address<n> or route<n>, ensuring
the appropriate value gets used for <n>.
N)rd   r   )r   r(   ra   r*   rc   s   &&&& r   _add_numberedNMConnection._add_numbered   s%    
 --gB$)GS!r"   c                    V R2pV P                   V,          P                  V4      pV'       d   V RV RV 2MV RV 2V P                   V,          V&   R# )zAdd route options to a given route

Example:
Given:
  section: ipv4
  route: route0
  key: mtu
  value: 500

Create line under [ipv4] section:
    route0_options=mtu=500

If the line already exists, then append the new key/value pair
_options,=N)r   get)r   r(   routerc   r*   numbered_keyroute_optionss   &&&&&  r   _add_route_optionsNMConnection._add_route_options   se      )G,00>  oQse1UG,5%! 	G\*r"   c                z    VR,          R,           \        VR,          4      ,           pV P                  VRV4       R# )z%
Adds an ipv[46]address<n> property.
address/prefixN)r   rg   )r   rB   subnetr*   s   &&& r   _add_addressNMConnection._add_address   s4    
 y!C'#fX.>*??69e4r"   c                F    RpVR,          ^ 8H  ;'       d    VR,          V9   # )::rv   network)r{   z0.0.0.0 )r   rn   default_netss   && r   _is_default_routeNMConnection._is_default_route   s(    (X!#HHi(8L(HHr"   c                   \        VR,          4      '       d   RMRpVR,           RVR,           2pRV9   d   VRVR,           2,          pRV9   dJ   V P                  V4      '       d    VR,           V P                  V,          R	&   MVRVR,           2,          pV P                  VR
4      pW0P                  V,          V&   RV9   d   V P	                  W$RVR,          4       R# R# )z!Adds a ipv[46].route<n> property.r|   r?   r>   ru   rv   gatewayrk   metriczroute-metricrn   mtuN)r   r   r   rd   rq   )r   rn   rB   r*   	route_keys   &&   r   
_add_routeNMConnection._add_route   s     +5+;<<&#$AeHo%67qy)*++Eu%%e,,9>x8IF#N31U8_-..33FGD	).FI&E>##FueElK r"   c                $   < V ^8  d   QhRS[ RR/# )rU   dnsrV   NrW   )rX   rY   s   "r   rZ   r[     s     
P 
P3 
P4 
Pr"   c                F   \        V4      '       d   RMRpV P                  P                  V4      '       dk   V P                  VR4      R8w  dR   V P	                  VRR4       V P                  V,          R,          V,           R,           V P                  V,          R&   R# R# R# )	z6
Extends the ipv[46].dns property with a name server.
r?   r>   r;   rN   r    ;N)r   r   r%   r3   r+   )r   r   rB   s   && r   _add_nameserverNMConnection._add_nameserver  s     +3//VKK##F++''9ZGfeR0)-V)<U)Cc)IC)ODKK& H ,r"   c                4   < V ^8  d   QhRS[ S[,          RR/# )rU   
dns_searchrV   N)r   r   )rX   rY   s   "r   rZ   r[     s      $s)  r"   c                L   R F  pV P                   P                  V4      '       g   K&  V P                  VR4      R8w  g   K?  V P                  VRR4       V P                   V,          R,          RP	                  V4      ,           R,           V P                   V,          R&   K  	  R# )z=
Extends the ipv[46].dns-search property with a name server.
r;   rN   z
dns-searchr   r   Nr=   )r   r%   r3   r+   join)r   r   rB   s   && r   _add_dns_searchNMConnection._add_dns_search  s     'F''//++FH=K!!&,;KK'5hhz*+ F#L1 'r"   c                6    V P                   R,          R,          # )z
Returns the connection UUID
r   r   r   r   s   &r   con_uuidNMConnection.con_uuid"  s     {{<(00r"   c                :    V P                   P                  RR4      # )z>
Can this be serialized into a meaningful connection profile?
r   type)r   r&   r   s   &r   validNMConnection.valid(  s     {{%%lF;;r"   c                B    V P                  RR4      P                  4       # )z
Sanitize a MAC address.
-:)replaceupper)addrs   &r   mac_addrNMConnection.mac_addr.  s    
 ||C%++--r"   c                   RRRRRRRRRRRR/pWAR	,          ,          pVf   R# R
V9   d   RpMRpWPP                   R,          R	&   VeI   W`P                   R,          R&   VP                  ! WR,           ,          4      V P                   R,          R&   / V P                   V&   R/ RRbRRbRRbRRbRRbRRbRRbRRbRR bR!R"bR#R$bR%R&bR'R(bR)R*bR+R,bR-R.bR/R0bR1R2R3R4R5R6R7R8R9R:R;R<R=R>R?R@RARBRCRDRERF/CRRGRHRIRJ/RRKRL/R/ R/ /pVRM,          pRp	. p
. pVR8X  d+   VRN,          '       g   Rh F  pV P                  VR4       K  	  VRN,           F  p\        V4      '       d   RPMROpV P                  WR	,          4       RQV9   d   V P	                  W4       RRV9   d   VRR,          V P                   V,          RR&   VRS,           F  pV P                  V4       K  	  RTV9   d   V
P                  VRT,          4       RUV9   d   VP                  VRU,          4       VRO8X  g   K  RMV9   g   K  VRM,          p	K  	  RVV9   d`   T
VRV,          RW,           Uu. uF  pW9  g   K  VNK  	  up,          p
TVRV,          RX,           Uu. uF  pVV9  g   K  VNK  	  up,          pV
'       g   VP                  '       d   VP                  p
V'       g   VP                  '       d   VP                  pV
 F  pV P                  V4       K  	  V'       d   V P                  V4       V P                  4        V	f   Tp	W8X  g    \        P                  RYVRZ,          VV	4       Wu,          P                  4        F  w  ppVV9  d   K  VV,          f   K  \        VV,          \         4      '       d*   VV,          '       d   R[MR\V P                   V,          V&   Kb  \#        VV,          4      V P                   V,          V&   K  	  VR8X  d   VR],          R^J d    \#        ^@4      V P                   R,          R_&   V	e    \#        V	4      V P                   R,          RM&   VR`,          e-   V P%                  VR`,          4      V P                   R,          Ra&   VR8X  d5   RbV9   d.   VP                  ! VRb,          4      V P                   R,          Rc&   VR8X  dD   V	e@   RV P                   9  d   / V P                   R&   \#        V	4      V P                   R,          RM&   VR8X  d   VRd,           FI  pVP&                  ! V4      pVP)                  RRR4       VP)                  RRV P+                  4       4       KK  	  VR`,          e-   V P%                  VR`,          4      V P                   R,          Ra&   VR8X  dq   V	em   ReV P                   R,          Rf&   \#        V	4      V P                   R,          RM&   VR`,          e-   V P%                  VR`,          4      V P                   R,          Ra&   VR8X  g#   V P                   P-                  VRa4      '       g    VRZ,          V P                   R,          Rg&   R# R# u upi u upi )izt
Integrate information from network state interface information
into the connection. Most of the work is done here.
physicalethernetvlanbondbridge
infinibandloopbackNr   zbond-masterr   z
slave-typez-mastermastermodez	bond-modemiimonzbond-miimonxmit_hash_policyzbond-xmit_hash_policynum_grat_arpzbond-num_grat_arp	downdelayzbond-downdelayupdelayzbond-updelayfail_over_maczbond-fail_over_macprimary_reselectzbond-primary_reselectprimaryzbond-primaryactive_slavezbond-active_slavead_actor_sys_priozbond-ad_actor_sys_prioad_actor_systemzbond-ad_actor_system	ad_selectzbond-ad_selectad_user_port_keyzbond-ad_user_port_keyall_slaves_activezbond-all_slaves_activearp_all_targetszbond-arp_all_targetsarp_intervalzbond-arp_intervalarp_ip_targetzbond-arp_ip_targetarp_validatezbond-arp_validate	lacp_ratezbond-lacp_ratelp_intervalzbond-lp_interval	min_linkszbond-min_linksnum_unsol_nazbond-num_unsol_napackets_per_slavezbond-packets_per_slavepeer_notif_delayzbond-peer_notif_delayresend_igmpzbond-resend_igmptlb_dynamic_lbzbond-tlb_dynamic_lbuse_carrierzbond-use_carrierstp
bridge_stpprioritybridge_bridgeprior   vlan_idr   subnetsr>   r?   rt   r   routesdns_nameserversr   r   nameserverssearchzZNetwork config: ignoring %s device-level mtu:%s because ipv4 subnet-level mtu:%s provided.namer<   r:   	wakeonlanTzwake-on-lanmac_addresszmac-addresszvlan-raw-deviceparentbridge_portsdatagramztransport-modezinterface-namer=   )r   con_refrR   r
   rx   r   extendr   dns_searchdomainsr   r   rC   LOGwarningitems
isinstanceboolr   r   get_connr+   r   r&   )r   ifacenetwork_stater	   	_type_mapif_type
slave_type	_prop_map
device_mtuipv4_mtufound_nameserversfound_dns_searchrB   rw   rn   r   r   
nameservernm_proprc   ports   &&&&                 r   render_interfaceNMConnection.render_interface5  s
    
FFh,
	 &M*?E!JJ,3L!&)!6@KK%l32:2B2B9,-3DKK%h/
  "G  ..-. #$;	.  3. -. >.  !5. #$;. >.  3." $%=#.& "#9'.* -+.. #$;/.0 $%=1.2 "#93.4  35.6  !5 3-1- 3#%="$;1 "71[.^ |/ i "q9
	v 5\
 fU9%5%5 +##FD1 + I&&F-f55V6Fv7F"!!&1F"17	1BF#I.))& * !F*!((0A)BCv% ''|(<=EVO!%=! '& E> <6"6C/ 6" 
 #El84!4F!11 4!  !]%B%B%B - = =M$C$C$C,>> ,J  , ,  !12 	113!H%KK>f &.446LGS%Sz!%*d++#CjjFg G$W- 14E#JG$W- 7 j [!T)9<TJ'6#14XJ'.]#/9=-(:J'6 f!2e!;,4,<,<'(-DKK) f!5,*,J'-0]DKK
#E*hn--((.!!,hG!!,$--/J . ]#/7;}}-(8H%m4 l"x';:DDKK%&67/28}DKK%e,]#/;?==-(<L)-8
 hdkk&<&<]'
 '
 ;@-DKK%&67'
}"
!s   
YY9	YYc                    \         P                  ! 4       pV P                  P                  VRR7       RpW!P	                  4       ,           # )z
Stringify.
F)space_around_delimitersz2# Generated by cloud-init. Changes will be lost.

)ioStringIOr   writegetvalue)r   bufheaders   &  r   dumpNMConnection.dump"  s:    
 kkm#u=G&&r"   r   N)__name__
__module____qualname____firstlineno____doc__r    r+   r/   r3   r6   rC   rR   rd   rg   rq   rx   r   r   r   r   r   r   staticmethodr   r   r   __static_attributes____classdictcell__rY   s   @r   r   r   *   s     9
0	1
1G0;7z *
.5IL$
P 
P  1< . .kHZ' 'r"   r   c                   P   a  ] tR tRt o RtR
R ltR tR tRV 3R lR lltR	t	V t
R# )Rendereri-  zRenders network information in a NetworkManager keyfile format.

See https://networkmanager.dev/docs/api/latest/nm-settings-keyfile.html
Nc                     / V n         Wn        R # N)connectionsr   )r   r   s   &&r   r    Renderer.__init__3  s    r"   c                (    V P                   V,          # r	  )r
  r   r   s   &&r   r   Renderer.get_conn7  s    ''r"   c                h    WP                   9   d"   V P                   V,          P                  4       # V# r	  )r
  r   r  s   &&r   r   Renderer.con_ref:  s/    %%%##F+4466 Mr"   c                :   < V ^8  d   QhRS[ RS[S[,          RR/# )rU   r   	templatesrV   N)r   r   dict)rX   rY   s   "r   rZ   Renderer.__annotate__A  s-     
 
#
 D>

 

r"   c                   VP                  4        FD  pVP                  R 4      ;'       g
    VR,          p\        VR,          4      V P                  V&   KF  	  VP                  4        FJ  pVP                  R 4      ;'       g
    VR,          pV P                  V,          pVP	                  WAV 4       KL  	  V P                  P                  4        FM  w  rvVP                  4       '       g   K  \        Ws4      p\        P                  ! WP                  4       R4       KO  	  \        P                  ! \        V4      \        R4       R# )	config_idr   i  N)iter_interfacesrm   r   r
  r   r   r   nm_conn_filenamer   
write_filer   cloud_init_nm_conf_filenameNM_IPV6_ADDR_GEN_CONF)	r   r   r  targetr   conn_keyconnr   r   s	   &&&&     r   render_network_stateRenderer.render_network_stateA  s     #224Eyy->>vH)5eFm)DDX& 5
 #224Eyy->>vH##H-D!!%= 5 !,,224LF::<<#F3DOOD))+u5	 5 	'/1F	
r"   )r   r
  r	  )NN)r   r   r   r   r  r    r   r   r  r  r  r  s   @r   r  r  -  s(     
(
 
 
r"   r  c                 R    \         P                  ! V\        4      pR V  R2pV RV 2# )zcloud-init-z.nmconnectionz/system-connections/r   target_path
NM_RUN_DIR)r   r  target_con_dircon_files   &&  r   r  r  b  s5    %%fj9NVHM2H1(<<r"   c                 P    \         P                  ! V\        4      pR V  2pV RV 2# )zifcfg-ru   )r   r#  IFCFG_CFG_FILE)devnamer  r%  r&  s   &&  r   sysconfig_conn_filenamer*  h  s2    %%fn=Ny!HQxj))r"   c                    \        V 4      p\        P                  P                  V4      '       g   \	        4       '       d   \        V 4      p\        P                  P                  V4      '       d   V# R# )a  
This function returns the name of the interface config file.
It first checks for presence of network manager connection file.
If absent and ifcfg-rh plugin for network manager is available,
it returns the name of the ifcfg file if it is present. If the
plugin is not present or the plugin is present but ifcfg file is
not, it returns None.
This function is called from NetworkManagerActivator class in
activators.py.
N)r  ospathisfiler   r*  )r)  	conn_files   & r   conn_filenamer0  n  sS     !)I
 77>>)$$)>)@)@+G4	y119;t;r"   c                 J    \         P                  ! V \        4      pR pV RV 2# )z$30-cloud-init-ip6-addr-gen-mode.confz/conf.d/r"  )r  r%  	conf_files   &  r   r  r    s+    %%fj9N6IXi[11r"   c                      ^ RI Hp  \        P                  ! R4      pRpV ! 4       '       d    \        P                  ! . RO4       \        V4      ;'       d    T#   \        P                   d    Rp L.i ; i)r   )uses_systemdnmcliTF)	systemctlz
is-enabledzNetworkManager.service)cloudinit.distrosr4  r   whichProcessExecutionErrorr   )r4  nmcli_presentservice_actives      r   	availabler<    sd     /JJw'MN~~	#IIKL 11>1 )) 	#"N	#s   A A43A4r	  )#r   r   r_   loggingr,  r   typingr   r   	cloudinitr   r   cloudinit.netr   r   r	   r
   cloudinit.net.network_stater   cloudinit.net.sysconfigr   r$  
NM_LIB_DIRr(  r  	getLoggerr   r   r   r  r  r*  r0  r  r<  r}   r"   r   <module>rE     s     	   	  !    5 9"
&
1  !@' @'F2
x   2
j=*<*22r"   