+
    i                        a  R t0 t R t^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHt RtR	tR
t]P*                  ! ]4      tRRRR.R]RR./t] ^ k R R ltR tRR R lltR tR tR tR# )z"Write Files: write arbitrary filesN)Optional)
url_helperutil)Cloud)Config)
MetaSchema)PER_INSTANCEi  Fz
text/plainidcc_write_filesdistrosall	frequencyactivate_by_schema_keyswrite_filesc          
      L    V ^8  d   QhR\         R\        R\        R\        RR/# )   namecfgcloudargsreturnN)strr   r   list)formats   "A/usr/lib/python3/dist-packages/cloudinit/config/cc_write_files.py__annotate__r   "   s6     O O O6 O% Ot O O    c                 `   VP                  R . 4      pV Uu. uF)  p\        P                  ! VR\        4      '       d   K'  VNK+  	  ppV'       g   \        P                  RV 4       R# \        P                  ! VP                  4      p\        WVP                  P                  V4       R# u upi )r   deferzESkipping module named %s, no/empty 'write_files' key in configurationN)getr   get_cfg_option_boolDEFAULT_DEFERLOGdebugfetch_ssl_detailspathsr   distrodefault_owner)r   r   r   r   	file_listffiltered_filesssl_detailss   &&&&    r   handler,   "   s    r*I A''7MB 	
  
 		;	

 	((5Kell&@&@+Ns   $B+ B+c                    V '       g   R p V P                  4       P                  4       p V R9   d   R.# V R9   d   RR.# V R9   d   R.# V \        8X  d   \        .# V '       d   \        P	                  RV \        4       \        .# ) application/x-gzipapplication/base64z%Unknown encoding type %s, assuming %s)gzgzip)z	gz+base64zgzip+base64zgz+b64zgzip+b64)b64base64)lowerstripTEXT_PLAIN_ENCr"   warning)encoding_types   &r   canonicalize_extractionr:   4   s    !'')//1M&$%%JJ$&:;;
 ))$%%&3	

 r   c                F    V ^8  d   QhR\         R\        \        ,          /# )r   ownerr+   )r   r   dict)r   s   "r   r   r   M   s     ($ ($C ($htn ($r   c           
      R   V'       g   R # \        V4       EF  w  rEVP                  R4      pV'       g!   \        P                  RV^,           V 4       K?  \        P
                  P                  V4      p\        VP                  RR 4      VVP                  RR 4      VP                  RR 4      4      pVf!   \        P                  RV^,           V 4       K  \        P                  ! VP                  RV4      4      w  r\        VP                  R4      \        4      p
\        P                  ! VR	4      '       d   R
MRp\        P                  ! WgWWR7       \        P                  ! WhV	4       \        P                  ! V4      V
8w  g   EKv  \        P                   ! Wj4       EK  	  R # )Npathz3No path provided to write for entry %s in module %ssourcecontentencodingz>No content could be loaded for entry %s in module %s; skippingr<   permissionsappendabwb)omodemodeusergroup)	enumerater   r"   r8   osr?   abspathread_url_or_decoder   extract_usergroupdecode_permsDEFAULT_PERMSr    
write_filechownbynameget_permissionschmod)r   filesr<   r+   if_infor?   contentsugpermsrG   s   &&&&        r   r   r   M   sK   u%	zz&!KKEA
 wwt$%JJx&JJy$'JJz4(	
 KKA	  ''

7E(BCVZZ6F00BB%!	
 	!$%.JJt#I &r   c                    V f   V#  \        V \        \        34      '       d   \        V 4      # \        \        V 4      ^4      #   \        \
        3 dm    . pY3 FF  p TP                  RT,          4       K    \         d    TP                  RT,          4        KD  i ; i	  \        P                  ! R.TO5!   Tu # i ; i)Nz%oz%rz0Undecodable permissions %s, returning default %s)	
isinstanceintfloatr   	TypeError
ValueErrorrD   r"   r8   )permdefaultrepsrs   &&  r   rP   rP   x   s    |dS%L))t9 s4y!$$z" A&D1H% &D1H%& !
 	FNNs:   &A A CA86C8#BCBC Cc                    V f   R MV P                  RR 4      p\        V4      pVf   V'       g   R# R pV'       d7    \        P                  ! VV P                  RR 4      ^^VR7      P                  pVe   V'       g   \        V4      p\        W'4      pV#   \
         d"    \        P                  ! \        RT4       Rp LOi ; i)Nurir.   headers)ri   retriessec_betweenr+   zVFailed to retrieve contents from source "%s"; falling back to data from "contents" keyF)r   boolr   read_file_or_urlrY   	Exceptionr   logexcr"   r:   extract_contents)r@   r+   rA   rB   urluse_urlresultextractionss   &&&&    r   rN   rN      s    .$fjj&=C3iGwF	  00

9d3' h " 7 .h7!'7M  	KK,	 G	s   5B )CCc                     T pV FQ  pVR 8X  d   \         P                  ! VRRR7      pK%  VR8X  d   \        P                  ! V4      pKD  V\        8X  g   KQ  KS  	  V# )r/   F)quietdecoder0   )r   decomp_gzipr4   	b64decoder7   )rY   extraction_typesrs   ts   &&  r   rp   rp      sY    F$$%%fE%HF&&%%f-F.   Mr   c                @    V ^8  d   Qh/ ^ \         9   d
   \        ;R&   # )r   meta)__conditional_annotations__r   )r   s   "r   r   r      s     ( (& j ' )r   )N) r~   __doc__r4   loggingrL   typingr   	cloudinitr   r   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   cloudinit.settingsr   rQ   r!   r7   	getLogger__name__r"   r}   r,   r:   r   rP   rN   rp   r   )r~   s   @r   <module>r      s    )   	  & ! # . +! 	
w	 O$2($V*"J	r   