+
    ˜qgjÁ9  ã                   óJ  € ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
HtHtHt ^ RIHtHt ] P"                  ! ]4      t]P(                  t]P*                  t]P,                  tRtR	R
.tRR.tR.tR	tRtRt. ROtRtR.t R t!R t"RR lt# ! R R4      t$R t%]3R lt&R# )é    N)ÚMIMEBase)ÚMIMEMultipart)ÚMIMENonMultipart)ÚMIMEText)ÚfeaturesÚhandlersÚutil)ÚUrlErrorÚread_file_or_urlzContent-Typez
text/plainztext/x-not-multipartztext/x-include-urlztext/x-include-once-urlztext/cloud-config-archiveztext/cloud-configzapplication/octet-streamzNumber-Attachmentsc                 ó   € W W V&   R # ©N© )ÚmsgÚkeyÚvalues   &&&Ú5/usr/lib/python3/dist-packages/cloudinit/user_data.pyÚ_replace_headerr   ;   s   € ØˆØˆƒHó    c                 óF   € V R  V P                  R R\        V4      R7       R# )zContent-DispositionÚ
attachment)ÚfilenameN)Ú
add_headerÚstr)r   r   s   &&r   Ú_set_filenamer   @   s"   € ØÐ!Ð"Ø‡N�NÐ(¨,ÄÀXÃ€NÖOr   c                 ót   € \         P                  '       d   \        V 4      Vh\        P	                  V 4       R # r   )r   ÚERROR_ON_USER_DATA_FAILUREÚRuntimeErrorÚLOGÚwarning)Úerror_messageÚsource_exceptions   &&r   Ú_handle_errorr"   E   s(   € Ü×*×*Ð*Ü˜=Ó)Ð/?Ð?ä�‰�MÖ"r   c                   ó`   a € ] tR t^Lt o R tR tR tR tR tR t	R t
R tRR
 ltR tRtV tR	# )ÚUserDataProcessorc                óH   € Wn         \        P                  ! V4      V n        R # r   )Úpathsr	   Úfetch_ssl_detailsÚssl_details)Úselfr&   s   &&r   Ú__init__ÚUserDataProcessor.__init__M   s   € ØŒ
Ü×1Ò1°%Ó8ˆÖr   c                óÈ   € \        4       p\        V\        4      '       d'   V F  pV P                  \	        V4      V4       K   	  V# V P                  \	        V4      V4       V# r   )r   Ú
isinstanceÚlistÚ_process_msgÚconvert_string)r)   ÚblobÚaccumulating_msgÚbs   &&  r   ÚprocessÚUserDataProcessor.processQ   s]   € Ü(›?ÐÜ�dœD×!Ò!Û�Ø×!Ñ!¤.°Ó"3Ð5EÖFñ ð  Ðð ×Ñœn¨TÓ2Ð4DÔEØÐr   c           
     ó  € R  pVP                  4        EF¤  p\        V4      '       d   K  RpVP                  4       p\        P                  ! V4      pRpV\
        9   d    \        P                  ! VRR7      pRpRpV'       g   \        pV\        R.,           9   d	   V! V4      pVf   TpV'       dŽ   VP                  R^4      w  r¼\        W¼4      pVP                  V4       VP!                  4       '       d   \#        WÔP!                  4       4       R F&  pWä9   g   K  \%        WÞ\'        WN,          4      4       K(  	  TpWV8w  d   \%        V\(        V4       V\*        9   d   V P-                  Wr4       EKc  V\.        9   d   V P1                  Wr4       EK‚  \%        V\(        V4       V P3                  W$4       EK§  	  R#   \        P                   d4   p	RP                  T\        T4      T	4      p
\        Y©4        Rp	?	EKî  Rp	?	ii ; i)	c                 ó.   € \         P                  ! V 4      # r   )r   Útype_from_starts_with)Úpayloads   &r   Ú
find_ctypeÚ2UserDataProcessor._process_msg.<locals>.find_ctype[   s   € Ü×1Ò1°'Ó:Ð:r   NF)ÚquietTz<Failed decompressing payload from {} of length {} due to: {}ztext/x-shellscriptÚ/)úLaunch-Index)ÚwalkÚis_skippableÚget_content_typer	   Úfully_decoded_payloadÚDECOMP_TYPESÚdecomp_gzipÚDecompressionErrorÚformatÚlenr"   Ú
UNDEF_TYPEÚTYPE_NEEDEDÚsplitr   Úset_payloadÚget_filenamer   r   r   ÚCONTENT_TYPEÚINCLUDE_TYPESÚ_do_includeÚARCHIVE_TYPESÚ_explode_archiveÚ_attach_part)r)   Úbase_msgÚ
append_msgr:   ÚpartÚctypeÚ
ctype_origr9   Úwas_compressedÚer    ÚmaintypeÚsubtypeÚn_partÚhs   &&&            r   r/   ÚUserDataProcessor._process_msgZ   sÊ  € ò	;ð —M‘M—OˆDÜ˜D×!Ò!ÙàˆEØ×.Ñ.Ó0ˆJÜ×0Ò0°Ó6ˆGØ"ˆNð
 œ\Ô)ðÜ"×.Ò.¨w¸eÔD�Gð "&�JØ%)�N÷ Ü'�
ð œ[Ð,@Ð+AÕAÔAÙ" 7Ó+�ØŠ}Ø"�÷ Ø$)§K¡K°°QÓ$7Ñ!�Ü)¨(Ó<�Ø×"Ñ" 7Ô+ð ×$Ñ$×&Ò&Ü! &×*;Ñ*;Ó*=Ô>Û*�AØ–yÜ'¨´3°tµw³<Ö@ñ +ð �àÔ"Ü ¤l°EÔ:àœÔ%Ø× Ñ  Ô5ÚàœÔ%Ø×%Ñ% gÔ:Úô ˜H¤l°EÔ:Ø×Ñ˜j×/óU $øô& ×.Ñ.ô ð0ß06±Ø&¬¨G«°aó1ð "ô " -Ô3Þûðús   Á!F?Æ?HÇ'HÈHc                ó   € VP                  R R4      pRpVP                  4       \        9   dA    \        P                  ! VP                  RR7      4      pV'       d   VP                  R4      pVe   TpVf   TpVe(    VP                  R \        \        V4      4      4       R# R#   \         d     LFi ; i  \        \        3 d     R# i ; i)r>   NT©Údecodeúlaunch-index)ÚgetrA   ÚEXAMINE_FOR_LAUNCH_INDEXr	   Ú	load_yamlÚget_payloadÚ	Exceptionr   r   ÚintÚ
ValueErrorÚ	TypeError)r)   r   Ú
header_idxÚpayload_idxr9   s   &&   r   Ú_attach_launch_indexÚ&UserDataProcessor._attach_launch_indexª   sÆ   € Ø—W‘W˜^¨TÓ2ˆ
ØˆØ×ÑÓ!Ô%=Ô=ðô Ÿ.š.¨¯©À¨Ó)EÓF�ßØ")§+¡+¨nÓ"=�Kð Ò!Ø$ˆKàÒØ$ˆKØÒ"ðØ—‘˜~¬s´3°{Ó3CÓ/DÖEñ #øô ô Ùðûô ¤	Ð*ô Úðús)   ¯-B' ÁB' Á?$B8 Â'B5Â4B5Â8CÃCc                ó¦   € \         P                  ! VR ^@4      p\        P                  P	                  V P
                  P                  R4      RV4      # )Úmd5ÚdataÚurlcache)r	   Ú	hash_blobÚosÚpathÚjoinr&   Úget_ipath_cur)r)   ÚentryÚentry_fns   && r   Ú_get_include_once_filenameÚ,UserDataProcessor._get_include_once_filenameÂ   s?   € Ü—>’> %¨°Ó3ˆÜ�w‰w�|‰|Ø�J‰J×$Ñ$ VÓ,¨j¸(ó
ð 	
r   c                ó‚   € VP                  4       '       g   \        V\        V,          4       V P                  V4       R # r   )rL   r   ÚPART_FN_TPLrm   )r)   r   Úattached_ids   &&&r   Ú_process_before_attachÚ(UserDataProcessor._process_before_attachÈ   s.   € Ø×Ñ×!Ò!Ü˜#œ{¨kÕ:Ô;Ø×!Ñ! #Ö&r   c                óÞ  € R pVP                  4        EFÚ  pVP                  4       pVP                  R4      '       d    V\        R4      R P	                  4       pRpM5VP                  R4      '       d   V\        R4      R P	                  4       pR pVP                  R4      '       d   K˜  VP                  4       pV'       g   K²  RpRpV'       d   V P                  V4      pV'       d=   \        P                  P                  V4      '       d   \        P                  ! V4      pM¤ \        V^^
V P                  R7      pV'       d9   VP                  4       '       d#   \        P                  ! WxP                   RR7       VP                  4       '       d   VP                   pM'R	P#                  WhP$                  4      p	\'        V	4        Vf   EK¾  \/        V4      pV P1                  WÒ4       EKÝ  	  R#   \(         d?   p
\+        T
4      pYk9  d   TR
P#                  T4      ,          p\'        Yº4        Rp
?
LnRp
?
i\,         d'   pRP#                  Yl4      p	\'        Yœ4        Rp?L�Rp?ii ; i)Fz#include-onceNTz#includeÚ#)ÚtimeoutÚretriesr(   i€  )Úmodez6Fetching from {} resulted in a invalid http code of {}z for url: {0}zFetching from {} resulted in {})Ú
splitlinesÚlowerÚ
startswithrG   ÚlstripÚstriprz   rt   ru   Úisfiler	   Úload_text_filer   r(   ÚokÚ
write_fileÚcontentsrF   Úcoder"   r
   r   ÚIOErrorr0   r/   )r)   ÚcontentrT   Úinclude_once_onÚlineÚlc_lineÚinclude_urlÚinclude_once_fnÚrespr    ÚurleÚmessageÚioeÚnew_msgs   &&&           r   rO   ÚUserDataProcessor._do_includeÍ   sÿ  € ð  ˆØ×&Ñ&×(ˆDØ—j‘j“lˆGØ×!Ñ! /×2Ò2ØœC Ó0Ð2Ð3×:Ñ:Ó<�ð #'‘Ø×#Ñ# J×/Ò/ØœC 
›OÐ-Ð.×5Ñ5Ó7�ð #(�Ø�‰˜s×#Ò#ÙØŸ*™*›,ˆKßÙà"ˆOØˆGßØ"&×"AÑ"AÀ+Ó"N�ß¤2§7¡7§>¡>°/×#BÒ#BÜ×-Ò-¨oÓ>‘ð 6Ü+Ø#Ø !Ø "Ø$(×$4Ñ$4ô	�D÷ '¨4¯7©7¯9ª9ÜŸšØ+¯]©]Àõð —w‘w—y’yØ"&§-¡-™ð9ß9?¹Ø +¯Y©Yó:ð &ô & mÕ4ð Õ"Ü(¨Ó1�Ø×!Ñ! '×6ó} )øô^  ô 1Ü! $›i�Gð #Ô1Ø ?×#9Ñ#9¸+Ó#FÕF˜Ü! '×0Ñ0ûÜô 6Ø$E×$LÑ$LØ#ó%�Mô " -×5Ñ5ûð	6ús<   Ä'6G4Å7G4ÆG4Æ#&G4Ç4I,Ç?4H8È8I,ÉI,ÉI'É'I,c                óú  € \         P                  ! V. \        \        3R 7      pV EFÐ  p\	        V\
        4      '       d   RV/p\	        V\        4      '       g   K6  VP                  RR4      pVP                  R4      pV'       g9   \        p\	        V\        4      '       d   \        p\        P                  ! WW4      pVP                  R^4      w  r‰VR8X  d4   \	        V\        4      '       d   VP                  4       p\        WYR7      p
M\!        W‰4      p
V
P#                  V4       RV9   d   \%        W¤R,          4       RV9   d#   V
P'                  R	\        VR,          4      4       \        VP)                  4       4       F]  pVP+                  4       RRRRR
\,        P+                  4       \.        P+                  4       39   d   KE  V
P'                  W´V,          4       K_  	  V P1                  W*4       EKÓ  	  R# ))ÚdefaultÚallowedr’   Ú Útyper=   Útext)Ú_subtyper   rb   r>   zcontent-dispositionN)r	   re   r.   Úsetr-   r   Údictrc   ÚARCHIVE_UNDEF_TYPEÚbytesÚARCHIVE_UNDEF_BINARY_TYPEr   r8   rJ   ra   r   r   rK   r   r   Úkeysr‡   ÚATTACHMENT_FIELDrM   rR   )r)   ÚarchiverT   ÚentriesÚentr’   ÚmtyperŸ   rZ   r[   r   Úheaders   &&&         r   rQ   Ú"UserDataProcessor._explode_archive  s�  € Ü—.’. °"¼tÄS¸kÔJˆÜˆCô ˜#œs×#Ò#Ø  #Ð&�Ü˜c¤D×*Ò*áà—g‘g˜i¨Ó,ˆGØ—G‘G˜F“OˆEßÜ,�Ü˜g¤u×-Ò-Ü7�GÜ ×6Ò6°wÓH�à %§¡¨C°Ó 3ÑˆHØ˜6Ô!Ü˜g¤u×-Ò-Ø%Ÿn™nÓ.�GÜ˜wÔ9‘ä˜xÓ1�Ø—‘ Ô(à˜SÔ Ü˜c z¥?Ô3Ø Ô$Ø—‘˜~¬s°3°~Õ3FÓ/GÔHä˜sŸx™x›zÖ*�Ø—<‘<“>ØØØØ"Ø)Ü$×*Ñ*Ó,Ü ×&Ñ&Ó(ð&ô ñ Ø—‘˜v¨6¥{Ö3ñ +ð ×Ñ˜j×.óa r   Nc                ó  € \         V9  d
   RV\         &   Ve   \        V\         \        V4      4       ^ p \        VP	                  \         4      4      pV#   \
        \        3 d    \        T\         \        T4      4        T# i ; i)zg
Return the number of attachments to this MIMEMultipart by looking
at its 'Number-Attachments' header.
Ú0)r«   r   r   rh   rc   ri   rj   )r)   Ú	outer_msgÚ	new_countÚfetched_counts   &&& r   Ú_multi_part_countÚ#UserDataProcessor._multi_part_countF  s…   € ô
  9Ô,Ø*-ˆIÔ&Ñ'àÒ Ü˜IÔ'7¼¸Y»ÔHàˆð	MÜ 	§¡Ô.>Ó ?Ó@ˆMð Ðøô œIÐ&ô 	MÜ˜IÔ'7¼¸]Ó9KÕLØÐð	Mús   ¶A Á+BÂBc                óª   € V P                  V4      pV P                  W#^,           4       VP                  V4       V P                  W^,           4       R# )z˜
Attach a message to an outer message. outermsg must be a MIMEMultipart.
Modifies a header in the outer message to keep track of number of
attachments.
N)r·   r   Úattach)r)   r´   rU   Ú
part_counts   &&& r   rR   ÚUserDataProcessor._attach_partX  sF   € ð ×+Ñ+¨IÓ6ˆ
Ø×#Ñ# D°q­.Ô9Ø×Ñ˜ÔØ×Ñ˜y°q­.Ö9r   )r&   r(   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r*   r4   r/   rm   rz   r   rO   rQ   r·   rR   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r$   r$   L   sA   ø‡ € ò9ò òN0ò`ò0
ò'ò
C7òJ2/ôh÷$	:ð 	:r   r$   c                 óh   € V P                  4       ;'       g    R pVP                  4       R8X  d   R# R# )r¡   Ú	multipartTF)Úget_content_maintyper‡   )rU   Úpart_maintypes   & r   r@   r@   d  s/   € à×-Ñ-Ó/×5Ð5°2€MØ×ÑÓ Ô+ÙÙr   c                ó:  € V '       g   Rp R p\        V \        4      '       d   V P                  R4      pMT p\        P                  ! VRR7      pRVR,          P                  4       9   d(   \        P                  ! VP                  R4      4      pV# V! W14      pV# )zFconvert a string (more likely bytes) or a message into
a mime message.r   c                 óf   € VP                  R ^4      w  r#\        W#4      pVP                  V 4       V# )r=   )rJ   r   rK   )rq   Úcontent_typerZ   r[   r   s   &&   r   Úcreate_binmsgÚ%convert_string.<locals>.create_binmsgs  s2   € Ø(×.Ñ.¨s°AÓ6ÑˆÜ�xÓ)ˆØ�‰˜ÔØˆ
r   zutf-8Fr`   s   mime-version::r   i   N)r-   r   Úencoder	   rD   r‡   Úmessage_from_stringra   )Úraw_datarÊ   rË   Úbdatar   s   &&   r   r0   r0   m  s‹   € ÷ Øˆòô �(œC× Ò Ø—‘ Ó(‰àˆÜ×Ò˜U¨5Ô1€EØ˜5 �=×.Ñ.Ó0Ô0Ü×&Ò& u§|¡|°GÓ'<Ó=ˆð €Jñ ˜EÓ0ˆà€Jr   )zapplication/gzipzapplication/gzip-compressedzapplication/gzippedzapplication/x-compresszapplication/x-compressedzapplication/x-gunzipzapplication/x-gzipzapplication/x-gzip-compressedr   )'Úloggingrt   Úemail.mime.baser   Úemail.mime.multipartr   Úemail.mime.nonmultipartr   Úemail.mime.textr   Ú	cloudinitr   r   r	   Úcloudinit.url_helperr
   r   Ú	getLoggerr½   r   ÚNOT_MULTIPART_TYPEr}   Ú
OCTET_TYPErM   rI   rN   rP   rH   r§   r©   rC   r«   rd   r   r   r"   r$   r@   r0   r   r   r   Ú<module>rÛ      sÔ   ðó Û 	Ý $Ý .Ý 4Ý $ç .Ñ .ß ;à×Ò˜Ó!€ð ×0Ñ0Ð Ø×"Ñ"€Ø× Ñ €
ð €ð Ð3Ð4€Ø%Ð'@ÐA€Ø,Ð-€Ø€
Ø(Ð Ø6Ð ò	€ð (Ð ð 0Ð0Ð òò
Pô
#÷U:ñ U:òpð +=ö r   