+
    i,                     8   ^ 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t]P                  ! ]4      t]	P                  ! R4      R 4       t]	P                  ! R4      R 4       t]R	R
3R lt]R	R
3R ltR t]	P                  ! R4      R 4       t]3R ltR# )    N)	b64decode	b64encode)performanceutili  zBase64 decodingc                b    \        V 4      p VP                  R4      #   \         d    Tu # i ; i)zbase64 decode data

:param source: a bytes or str to decode
:return: base64 as a decoded str if utf-8 encoded, otherwise bytes
utf-8)r   decodeUnicodeDecodeError)sourcedecodeds   & 9/usr/lib/python3/dist-packages/cloudinit/atomic_helper.pyb64dr      s6     G~~g&& s    ..zBase64 encodingc                    \        V \        4      '       g   V P                  R4      p \        V 4      P	                  R4      # )zXbase64 encode data

:param source: a bytes or str to decode
:return: base64 encoded str
r   )
isinstancebytesencoder   r	   )r   s   &r   b64er      s5     fe$$w'V##G,,    wbFc           	         \         P                  ! RV  24      ;_uu_ 4        \        WW#V4      uuRRR4       #   + '       g   i     R# ; i)zCopen filename in mode omode, write content, set permissions to modezWriting N)r   Timed_write_file)filenamecontentmodeomodepreserve_modes   &&&&&r   
write_filer   *   s7    
 
		XhZ0	1	18d=I 
2	1	1	1s	   :A	c           
         V'       d8    \         P                  ! V 4      p\        P                  ! VP                  4      pR p \         P
                  P                  V 4      p\        P                  ! V4       \        P                  ! VRVR7      p\        P                  RV VP                  VV\        V4      4       VP                  V4       VP!                  4        \         P"                  ! VP                  V4       \         P$                  ! VP                  V 4       R #   \         d     Li ; i  \&         d,   pTe!   \         P(                  ! TP                  4       ThR p?ii ; i)NF)dirdeleter   zOAtomically writing to file %s (via temporary file %s) - %s: [%o] %d bytes/chars)osstatS_IMODEst_modeOSErrorpathdirnamer   
ensure_dirtempfileNamedTemporaryFileLOGdebugnamelenwriteclosechmodrename	Exceptionunlink)	r   r   r   r   r   	file_stattfr(   es	   &&&&&    r   r   r   3   s    	)I<<	 1 12D 
B''//(+ ((WUO		GGL	
 	


$
		"''8$)  		*  >IIbggs*   6D# CD4 #D10D14E*?&E%%E*c                     RP                  \        V 4      4      #   \         d    RP                  \        T 4      4      u # i ; i)z1Handler for types which aren't json serializable.z
ci-b64:{0}z)Warning: redacted unserializable type {0})formatr   AttributeErrortype)_objs   &r   json_serialize_defaultr>   U   sC    N""4:.. N:AA$t*MMNs    %AAzDumping jsonc                @    \         P                  ! V ^RR\        R7      # )z%Return data in nicely formatted json.T)indent	sort_keys
separatorsdefault),z: )jsondumpsr>   )datas   &r   
json_dumpsrH   ]   s$     ::& r   c                 @    \        V \        V4      R ,           RVR7      # )
w)r   r   )r   rH   )r   rG   r   s   &&&r   
write_jsonrL   i   s%    44	 r   )rE   loggingr"   r#   r*   base64r   r   	cloudinitr   r   
_DEF_PERMS	getLogger__name__r,   timedr   r   r   r   r>   rH   rL    r   r   <module>rU      s      	   ' '
! $%
 &
 $%- &- 'd%J 'd%DN >" # %/ r   