%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__/temp_utils.cpython-312.pyc

�

�f�����ddlZddlZddlZddlZddlZddlZddlmZeje	�Z
dadZdZ
ddefd�Zddefd�Zd�Zej$d
d	��Zddefd
�Zddefd�Zy)�N)�utilz/run/cloud-init/tmpz/var/tmp/cloud-init�	needs_exec��|�|S|rtStrtStj�dk(rtStj
j
dd�S)Nr�TMPDIRz/tmp)�_EXE_ROOT_TMPDIR�_TMPDIR�os�getuid�_ROOT_TMPDIR�environ�get)�odirrs  �6/usr/lib/python3/dist-packages/cloudinit/temp_utils.py�get_tmp_ancestorrsG������������	�y�y�{�a����
�:�:�>�>�(�F�+�+�c��t||�}tjj|�s+tj|�tj
|d�|r,t
j|d�rtjd|�|�|s|a
|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�warningr)rr�tdirs   r�_tempfile_dir_argrst���D�)�,�D�
�7�7�=�=���
���D��
����v������d�H�-��K�K�%��
��|�I����Krc����t|jdd�|jdd��|d<tjdi|���d�}|�_�fd�}t�d|��S)N�dirrFc��	tj|�y#t$r)}|jtjk7r|�Yd}~yd}~wwxYw�N)r	�unlink�OSError�errno�ENOENT)r�es  r�_unlink_if_existsz0ExtendedTemporaryFile.<locals>._unlink_if_existsIs<��	��I�I�d�O���	��w�w�%�,�,�&���'��	�s��	A
�A�A
c�<���j�j�yr )r!�name)�fhs�r�
unlink_nowz)ExtendedTemporaryFile.<locals>.unlink_nowWs���
�	�	�"�'�'�rr*�)r�pop�tempfile�NamedTemporaryFiler!�setattr)�kwargsr&r*r)s   @r�ExtendedTemporaryFiler1@sg���%��
�
�5�$�����K��!?��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_errorsr0rs   r�tempdirr8^s>����
��V��D�@��
��
�
�d�*>�?���
�
�d�*>�?�s�A�+�A�A�Ac�H�t||�}tjdd|i|��S�Nrr+)rr-r4�rrr0s   rr4r4j�'��
�C��
+�C����.��.�v�.�.rc�H�t||�}tjdd|i|��Sr:)rr-�mkstempr;s   rr>r>or<r)NF)F)�
contextlibr#�loggingr	r5r-�	cloudinitr�	getLogger�__name__rrrr�boolrrr1�contextmanagerr8r4r>r+rr�<module>rFs������	�
����g����!��
��$��(��	,�4�	,��D��D�<���@��@�/��/�
/��/r

Zerion Mini Shell 1.0