%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/__pycache__/atomic_helper.cpython-312.pyc

�

�f�	���ddlZddlZddlZddlZddlZddlmZmZdZeje
�Zd�Zd�Z
eddfd�Zd	�Zd
�Zefd�Zy)�N)�	b64decode�	b64encodei�c�^�t|�}	|jd�S#t$r|cYSwxYw�Nzutf-8)r�decode�UnicodeDecodeError)�source�decodeds  �9/usr/lib/python3/dist-packages/cloudinit/atomic_helper.py�b64drs6�����G���~�~�g�&�&�������s��,�,c�x�t|t�s|jd�}t|�j	d�Sr)�
isinstance�bytes�encoderr)r	s r�b64ers2���f�e�$����w�'���V��#�#�G�,�,��wbFc
��|r5	tj|�}tj|j�}d}	tjtjj|�d|��}tjd||j||t|��|j|�|j�tj|j|�tj |j|�y#t$rY��wxYw#t"$r(}|�tj$|j�|�d}~wwxYw)NF)�dir�delete�modezOAtomically writing to file %s (via temporary file %s) - %s: [%o] %d bytes/chars)�os�stat�S_IMODE�st_mode�OSError�tempfile�NamedTemporaryFile�path�dirname�LOG�debug�name�len�write�close�chmod�rename�	Exception�unlink)�filename�contentr�omode�
preserve_mode�	file_stat�tf�es        r�
write_filer2 s��
�	�����)�I��<�<�	� 1� 1�2�D�
�B��
�
(�
(�������)�%�e�
��	�	�	�
���G�G�����L�	
�	�����
���
�
������$��
�	�	�"�'�'�8�$��)�	��	��*��
�>��I�I�b�g�g������s)�4C?�CD�?	D�
D�	D?�#D:�:D?c��	djt|��S#t$rdjt|��cYSwxYw)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_defaultr8DsC��N��"�"�4��:�.�.���N�:�A�A�$�t�*�M�M�N�s��#A�Ac�>�tj|dddt��S)z%Return data in nicely formatted json.�T)�,z: )�indent�	sort_keys�
separators�default)�json�dumpsr8)�datas r�
json_dumpsrCLs"���:�:�����&��rc�8�t|t|�dzd|��S)N�
�w)r-r)r2rC)r+rBrs   r�
write_jsonrGWs%�����4��4���
�	�r)r@�loggingrrr�base64rr�
_DEF_PERMS�	getLogger�__name__r!rrr2r8rCrG�rr�<module>rNs^����	���'�
�
��g����!���-�'�d�%�!�HN��%/�r

Zerion Mini Shell 1.0