+
    ˜qgj=%  ã                   ó  € ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
HtHt RtRt]P                  ! ]4      t ! R R] P$                  R7      t ! R	 R
]4      t].tRR ltR tRR ltR tR tR tRR ltR# )é    N)Úutil)Úget_devicelistÚread_sys_net_safez#/run/initramfs/open-iscsi.interfaceÚdisabledc                   ó„   a € ] tR t^t o Rt]P                  V 3R lR l4       t]P                  V 3R lR l4       tRt	V t
R# )ÚInitramfsNetworkConfigSourcezBABC for net config sources that read config written by initramfsesc                ó    <€ V ^8„  d   QhRS[ /# ©é   Úreturn©Úbool)ÚformatÚ__classdict__s   "€Ú7/usr/lib/python3/dist-packages/cloudinit/net/cmdline.pyÚ__annotate__Ú)InitramfsNetworkConfigSource.__annotate__   s   ø€ ÷ Pñ P™tñ Pó    c                ó   € R# )zAIs this initramfs config source applicable to the current system?N© ©Úselfs   &r   Úis_applicableÚ*InitramfsNetworkConfigSource.is_applicable   ó   ‚ r   c                ó    <€ V ^8„  d   QhRS[ /# r
   ©Údict)r   r   s   "€r   r   r   #   s   ø€ ÷ Jñ J™tñ Jr   c                ó   € R# )z;Render a v1 network config from the initramfs configurationNr   r   s   &r   Úrender_configÚ*InitramfsNetworkConfigSource.render_config"   r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚabcÚabstractmethodr   r    Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      s>   ø‡ € ÙLà×Ñ÷Pó ðPð 	×Ñ÷Jó öJr   r   )Ú	metaclassc                   ód   a € ] tR t^'t o RtRR ltV 3R lR ltV 3R lR ltV 3R lR	 ltR
t	V t
R# )ÚKlibcNetworkConfigSourcezáInitramfsNetworkConfigSource for klibc initramfs (i.e. Debian/Ubuntu)

Has three parameters, but they are intended to make testing simpler, _not_
for use in production code.  (This is indicated by the prepended
underscores.)
Nc                óL  € Wn         W n        W0n        V P                   f   \        4       V n         V P                  f   \        P
                  ! 4       V n        V P                  f?   / V n        \        4        F'  p\        VR4      pV'       g   K  WPP                  V&   K)  	  R # R # )NÚaddress)Ú_filesÚ
_mac_addrsÚ_cmdlineÚ_get_klibc_net_cfg_filesr   Úget_cmdliner   r   )r   r1   r2   r3   ÚkÚmac_addrs   &&&&  r   Ú__init__Ú!KlibcNetworkConfigSource.__init__/   s�   € ØŒØ$ŒØ Œð �;‰;ÒÜ2Ó4ˆDŒKØ�=‰=Ò Ü ×,Ò,Ó.ˆDŒMØ�?‰?Ò"Ø ˆDŒOÜ#Ö%�Ü,¨Q°	Ó:�ß‘8Ø)1—O‘O AÓ&ó &ñ #r   c                ó    <€ V ^8„  d   QhRS[ /# r
   r   )r   r   s   "€r   r   Ú%KlibcNetworkConfigSource.__annotate__A   s   ø€ ÷ ñ ™tñ r   c                ó`   € V P                  4       ;p'       d   \        P                  R4       V# )z>Return whether this system has klibc initramfs network config.z)Using initramfs network config from klibc)Ú_is_applicableÚLOGÚdebug)r   r   s   & r   r   Ú&KlibcNetworkConfigSource.is_applicableA   s+   € ð !×/Ñ/Ó1Ð1ˆ=Ö1Ü�I‰IÐAÔBØÐr   c                ó    <€ V ^8„  d   QhRS[ /# r
   r   )r   r   s   "€r   r   r;   H   s   ø€ ÷ ñ ¡ñ r   c                ó  € V P                   '       dm   \        P                  ! V P                  4       F  pVP	                  R4      '       g   K   R# 	  \
        P                  P                  \        4      '       d   R# R# )zÆ
Will return True if:
    (a) klibc files exist in /run, AND
    (b) either:
        (i) ip= or ip6= are on the kernel cmdline, OR
        (ii) an open-iscsi interface file is present in the system
TF)zip=zip6=)	r1   ÚshlexÚsplitr3   Ú
startswithÚosÚpathÚexistsÚ_OPEN_ISCSI_INTERFACE_FILE)r   Úitems   & r   r=   Ú'KlibcNetworkConfigSource._is_applicableH   sR   € ð �;�;ˆ;ÜŸš D§M¡MÖ2�Ø—?‘? ?×3Ô3Úñ 3ô �w‰w�~‰~Ô8×9Ò9áÙr   c                ó    <€ V ^8„  d   QhRS[ /# r
   r   )r   r   s   "€r   r   r;   Y   s   ø€ ÷ 
ñ 
™tñ 
r   c                óD   € \        V P                  V P                  R 7      # ))ÚfilesÚ	mac_addrs)Úconfig_from_klibc_net_cfgr1   r2   r   s   &r   r    Ú&KlibcNetworkConfigSource.render_configY   s   € Ü(Ø—+‘+Ø—o‘oô
ð 	
r   )r3   r1   r2   )NNN)r"   r#   r$   r%   r&   r8   r   r=   r    r)   r*   r+   s   @r   r.   r.   '   s-   ø‡ € ñô2÷$ð ÷ð ÷"
ö 
r   r.   c                óˆ  € Vf   / p\         P                  ! V 4      p RV9   d
   VR,          MVR,          pTP	                  RTP	                  R4      4      pT'       g   TP	                  R4      '       d   RpMR	pTR9   d   R	pTR9  d   \        RT,          4      hRRRTR. /pY19   d   Y,          TR&   R EFd  pTR,           T9  d   K  TP	                  TR,           T4      pTR	8X  d   R
pRTRR/p	TR
8X  d   Y'R,           ,          T	R&   R F1  p
Yz,           T9   g   K  Y'T
,           ,          YšP                  4       &   K3  	  . pR Fd  pTP	                  Y|,           4      pT'       g   K$  \        TP                  R4      4      '       g   KF  TP                  Y'T,           ,          4       Kf  	  T'       dM   Y¹R&   TP	                  R4      pT'       d0   RT9   d   TP                  R4      T	R&   MTP                  4       T	R&   TR,          P                  T	4       EKg  	  Y63#   \         d   p\        R4      ThRp?ii ; i)aÕ  Convert a klibc written shell content file to a 'config' entry
When ip= is seen on the kernel command line in debian initramfs
and networking is brought up, ipconfig will populate
/run/net-<name>.cfg.

The files are shell style syntax, and examples are in the tests
provided here.  There is no good documentation on this unfortunately.

DEVICE=<name> is expected/required and PROTO should indicate if
this is 'none' (static) or 'dhcp' or 'dhcp6' (LP: #1621507) or 'static'
or 'off' (LP: 2065787). Note that IPV6PROTO is also written to address
the possibility of both ipv4 and ipv6 getting addresses.

Full syntax is documented at:
https://git.kernel.org/pub/scm/libs/klibc/klibc.git/plain/usr/kinit/ipconfig/README.ipconfig
NÚDEVICEÚDEVICE6z&no 'DEVICE' or 'DEVICE6' entry in dataÚPROTOÚ	IPV6PROTOÚfilenameÚdhcpÚnoneÚstaticzUnexpected value for PROTO: %sÚtypeÚphysicalÚnameÚsubnetsÚmac_addressÚADDRÚcontrolÚmanualr0   z:.0Údns_nameserversÚDOMAINSEARCHÚ,Ú
dns_search)rZ   Úoff)rY   rX   Údhcp6)ÚIPV4ÚIPV6)ÚNETMASKÚ	BROADCASTÚGATEWAY)ÚDNS0ÚDNS1)
r   Úload_shell_contentÚKeyErrorÚ
ValueErrorÚgetÚlowerÚlenÚstripÚappendrD   )ÚcontentrO   Údatar]   ÚeÚprotoÚifaceÚpreÚ	cur_protoÚsubnetÚkeyÚdnsÚnskeyÚnsÚsearchs   &&             r   Ú_klibc_to_config_entryr…   c   s-  € ð$ ÒØˆ	ä×"Ò" 7Ó+€DðJØ!)¨TÔ!1ˆt�HŽ~°t¸Iµˆð �H‰H�W˜dŸh™h {Ó3Ó4€EßØ�8‰8�J×ÒØ‰EàˆEàÐ!Ô!ØˆàÐ-Ô-ÜÐ9¸EÕAÓBÐBð 	�
Ø�Ø�2ð€Eð ÔØ(�ˆˆmÑô  ˆà��<˜tÔ#Ùð —H‘H˜S 7�]¨EÓ2ˆ	à˜ÔØ ˆIØ˜) Y°Ð9ˆð ˜Ô Ø $¨6¥\Õ 2ˆF�9Ñó 7ˆCØ�y˜DÖ Ø&*°­9¥o�—y‘y“{Ó#ñ 7ð ˆã%ˆEØ—‘˜#�+Ó&ˆBç‰r”c˜"Ÿ(™( 5›/×*Ô*Ø—
‘
˜4 e¥Õ,Ö-ñ	 &÷
 Ø(+Ð$Ñ%à—X‘X˜nÓ-ˆFßØ˜&”=Ø+1¯<©<¸Ó+<�F˜<Ò(à+1¯<©<«>�F˜<Ñ(àˆiÕ×Ñ ×'ñO  ðR ˆ;ÐøôK ô JÜÐAÓBÈÐIûðJús   žH% È%IÈ0H<È<Ic                  ód   € \         P                   ! R 4      \         P                   ! R4      ,           # )z/run/net-*.confz/run/net6-*.conf)Úglobr   r   r   r4   r4   Ã   s!   € Ü�9Š9Ð&Ó'¬$¯)ª)Ð4FÓ*GÕGÐGr   c                 ód  € V f   \        4       p . p/ pV  EF  p\        \        P                  ! V4      VR7      w  rVWS9   dÌ   W5,          R,          pVP	                  R4      VP	                  R4      8w  dY   \        RP                  VRP                  W5,          R,          4      VP	                  R4      VP	                  R4      R7      4      hVR,          P                  VR,          4       W5,          R,          P                  V4       Kø  RV.RV/W5&   VP                  V4       EK  	  R	VR
^/# )N)rO   Úentryr_   zedevice '{name}' was defined multiple times ({files}) but had differing mac addresses: {old} -> {new}.Ú rN   )r]   rN   ÚoldÚnewr^   ÚconfigÚversion)
r4   r…   r   Úload_text_filers   rr   r   ÚjoinÚextendrw   )rN   rO   ÚentriesÚnamesÚcfg_filer]   r‰   Úprevs   &&      r   rP   rP   Ç   s  € Ø‚}Ü(Ó*ˆà€GØ€EÜˆÜ,Ü×Ò Ó)°Yô
‰ˆð Œ=Ø•;˜wÕ'ˆDØ�x‰x˜Ó&¨%¯)©)°MÓ*BÔBÜ ðHßHNÉØ!Ø!Ÿh™h u¥{°7Õ';Ó<Ø ŸH™H ]Ó3Ø!ŸI™I mÓ4ð	 IOó Ióð ð ��O×"Ñ" 5¨Õ#3Ô4Ø�K˜Õ ×'Ñ'¨Ö1à" X J°¸Ð?ˆE‰KØ�N‰N˜5×!ñ) ð, �g˜y¨!Ð,Ð,r   c                 ó~   € \          F2  p V ! 4       pVP                  4       '       g   K"  VP                  4       u # 	  R# )zú
Return v1 network config for initramfs-configured networking (or None)

This will consider each _INITRAMFS_CONFIG_SOURCES entry in turn, and return
v1 network configuration for the first one that is applicable.  If none are
applicable, return None.
N)Ú_INITRAMFS_CONFIG_SOURCESr   r    )Úsrc_clsÚ
cfg_sources     r   Úread_initramfs_configrš   æ   s;   € ÷ -ˆÙ“Yˆ
à×'Ñ'×)Ò)Ùà×'Ñ'Ó)Ò)ñ -ñ r   c                 ó¨  € \         P                  ! V 4      ;_uu_ 4       pR p \        P                  ! RVR7      pVP	                  4       V'       d   VP                  4        uuR R R 4       #   \         d(    T u T'       d   TP                  4        uuR R R 4       # i ; i  T'       d   TP                  4        i i ; i  + '       g   i     R # ; i)NÚrb)ÚmodeÚfileobj)ÚioÚBytesIOÚgzipÚGzipFileÚreadÚcloseÚIOError)ÚblobÚiobufÚgzfps   &  r   Ú_decomp_gzipr©   ø   s–   € ä	�Š�D×	Ô	˜UØˆð	Ü—=’= d°EÔ:ˆDØ—9‘9“;÷ Ø—
‘
”÷ 
Ò	øô
 ô 	Ø‰KçØ—
‘
”÷ 
Ò	ð
	û÷ Ø—
‘
•ð ú÷ 
×	Ð	ús@   ŸC £'A-Á
C Á-BÁ:B"Á;C ÂBÂB"Â"B=Â=C Ã C	c                ó¢   €  \         P                  ! V 4      p\        T4      #   \        \        3 d    \        P                  RT 4        R# i ; i)zšDecode a string base64 encoding, if gzipped, uncompress as well

:return: decompressed unencoded string of the data or empty string on
   unencoded data.
zaExpected base64 encoded kernel command line parameter network-config. Ignoring network-config=%s.Ú )Úbase64Ú	b64decodeÚ	TypeErrorrr   r>   Úerrorr©   )ry   r¦   s   & r   Ú_b64dgzr°     sS   € ðÜ×Ò Ó%ˆô ˜ÓÐøô ”zÐ"ô Ü�	‰	ð;àô	
ò
 ðús   ‚# £'AÁAc                 óH  € V f   \         P                  ! 4       p RV 9   d‚   R pV P                  4        F5  pVP                  R4      '       g   K  VP                  R^4      ^,          pK7  	  V'       d/   V\        8X  d   RR/# \         P
                  ! \        V4      4      # R # )Nznetwork-config=Ú=r�   r   )r   r5   rD   rE   Ú&KERNEL_CMDLINE_NETWORK_CONFIG_DISABLEDÚ	load_yamlr°   )ÚcmdlineÚdata64Útoks   &  r   Úread_kernel_cmdline_configr¸     s†   € Ø‚Ü×"Ò"Ó$ˆà˜GÔ#ØˆØ—=‘=–?ˆCØ�~‰~Ð/×0Ô0ØŸ™ 3¨Ó*¨1Õ-’ñ #÷ ØÔ?Ô?Ø  *Ð-Ð-Ü—>’>¤'¨&£/Ó2Ð2ár   )N)NN)r'   r¬   r‡   r¡   rŸ   ÚloggingrF   rC   Ú	cloudinitr   Úcloudinit.netr   r   rI   r³   Ú	getLoggerr"   r>   ÚABCMetar   r.   r—   r…   r4   rP   rš   r©   r°   r¸   r   r   r   Ú<module>r¾      s’   ðó Û Û Û Û 	Û Û 	Û å ß ;àBÐ à)3Ð &à×Ò˜Ó!€ô	J¨S¯[©[õ 	Jô6
Ð;ô 6
ðr 6Ð6Ð ô]ò@Hô-ò>ò$òö&r   