%PDF- %PDF-
Mini Shell

Mini Shell

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

�

���f�����ddlZddlZddlZddlZddlZddlZddlmZeje	�Z
dZdZdde
fd�Zdde
fd�Zd�Zej"d
d	��Zdde
fd
�Zdde
fd�Zy)�N)�utilz/run/cloud-init/tmpz/var/tmp/cloud-init�	needs_exec��|�|S|rtStj�dk(rtStjjdd�S)Nr�TMPDIRz/tmp)�_EXE_ROOT_TMPDIR�os�getuid�_ROOT_TMPDIR�environ�get)�odirrs  �6/usr/lib/python3/dist-packages/cloudinit/temp_utils.py�get_tmp_ancestorrs?���������	�y�y�{�a����
�:�:�>�>�(�F�+�+�c��t||�}tjj|�s+tj|�tj
|d�|r,t
j|d�rtjd|�|S)a%Return the proper 'dir' argument for tempfile functions.

    When root, cloud-init will use /run/cloud-init/tmp to avoid
    any cleaning that a distro boot might do on /tmp (such as
    systemd-tmpfiles-clean).

    If the caller of this function (mkdtemp or mkstemp) was provided
    with a 'dir' argument, then that is respected.

    @param odir: original 'dir' arg to 'mkdtemp' or other.
    @param needs_exe: Boolean specifying whether or not exe permissions are
        needed for tempdir. This is needed because /run is mounted noexec.
    i��noexeczDRequested temporal dir with exe permission `%s` is mounted as noexec)
rr�path�isdir�makedirs�chmodr�
has_mount_opt�LOG�warning)r
r�tdirs   r�_tempfile_dir_argrsh���D�)�,�D�
�7�7�=�=���
���D��
����v������d�H�-��K�K�%��
�
�Krc���t�|d<tjdi|���d�}|�_�fd�}t	�d|��S)N�dirc��	tj|�y#t$r)}|jtjk7r|�Yd}~yd}~wwxYw�N)r�unlink�OSError�errno�ENOENT)r�es  r�_unlink_if_existsz0ExtendedTemporaryFile.<locals>._unlink_if_exists?s<��	��I�I�d�O���	��w�w�%�,�,�&���'��	�s��	A
�A�A
c�<���j�j�yr)r �name)�fhs�r�
unlink_nowz)ExtendedTemporaryFile.<locals>.unlink_nowMs���
�	�	�"�'�'�rr)�)r�tempfile�NamedTemporaryFiler �setattr)�kwargsr%r)r(s   @r�ExtendedTemporaryFiler/8sH���%�'�F�5�M�	�	$�	$�	.�v�	.�B�
�"�B�I���B��j�)�
�Irc+�K�tdi|��}	|��tj||��y#tj||��wxYw�w)N)�
ignore_errorsr*)�mkdtemp�shutil�rmtree)�rmtree_ignore_errorsr.rs   r�tempdirr6Ts>����
��V��D�@��
��
�
�d�*>�?���
�
�d�*>�?�s�A�+�A�A�Ac�H�t||�}tjdd|i|��S�Nrr*)rr+r2�rrr.s   rr2r2`�'��
�C��
+�C����.��.�v�.�.rc�H�t||�}tjdd|i|��Sr8)rr+�mkstempr9s   rr<r<er:r)NF)F)�
contextlibr"�loggingrr3r+�	cloudinitr�	getLogger�__name__rr
r�boolrrr/�contextmanagerr6r2r<r*rr�<module>rDs������	�
����g����!��$��(��,�4�,��D��:�8���@��@�/��/�
/��/r

Zerion Mini Shell 1.0