HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/lib/python3/dist-packages/cloudinit/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3/dist-packages/cloudinit/__pycache__/temp_utils.cpython-311.pyc
�

܍~c�����ddlZddlZddlZddlZddlZddlmZddlmZej	e
��ZdadZ
dZddefd�Zddefd	�Zd
�Zejdd���Zddefd�Zddefd
�ZdS)�N)�log)�utilz/run/cloud-init/tmpz/var/tmp/cloud-initF�	needs_exec��|�|S|rtStrtStj��dkrtStj�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_ancestorrsU������� �������	�y�{�{�a�����
�:�>�>�(�F�+�+�+�c�&�t||��}tj�|��s)tj|��tj|d��|r0t
j|d��rt�	d|��|�|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_argrs����D�)�,�,�D�
�7�=�=�����
��D����
���v��������d�H�-�-�	��K�K�%��
�
�
��|�I�|����Krc����t|�dd��|�dd����|d<tjdi|���d�}|�_�fd�}t�d|���S)N�dirrFc��	tj|��dS#t$r"}|jtjkr|�Yd}~dSd}~wwxYw�N)r
�unlink�OSError�errno�ENOENT)r�es  r�_unlink_if_existsz0ExtendedTemporaryFile.<locals>._unlink_if_existsIs_��	��I�d�O�O�O�O�O���	�	�	��w�%�,�&�&���'�&�&�&�&�&�����	���s��
A�?�Ac�<�����j��dSr!)r"�name)�fhs�r�
unlink_nowz)ExtendedTemporaryFile.<locals>.unlink_nowWs���
�	�	�"�'�����rr+�)r�pop�tempfile�NamedTemporaryFiler"�setattr)�kwargsr'r+r*s   @r�ExtendedTemporaryFiler2@s����%��
�
�5�$������K��!?�!?���F�5�M�
�	$�	.�	.�v�	.�	.�B�
���"�B�I�������B��j�)�)�)�
�Irc+�K�tdi|��}	|V�tj||���dS#tj||���wxYw)N)�
ignore_errorsr,)�mkdtemp�shutil�rmtree)�rmtree_ignore_errorsr1rs   r�tempdirr9^sb����
���V���D�@��
�
�
��
�d�*>�?�?�?�?�?�?���
�d�*>�?�?�?�?�?���s	�,�Ac�H�t||��}tjdd|i|��S�Nrr,)rr.r5�rrr1s   rr5r5j�-��
�C��
+�
+�C���.�.��.�v�.�.�.rc�H�t||��}tjdd|i|��Sr;)rr.�mkstempr<s   rr?r?or=r)NF)F)�
contextlibr$r
r6r.�	cloudinitr�loggingr�	getLogger�__name__rr	rr�boolrrr2�contextmanagerr9r5r?r,rr�<module>rGs?����������	�	�	�	�
�
�
�
�����$�$�$�$�$�$��������g���!�!��
��$��(��	,�	,�4�	,�	,�	,�	,���D�����D���<��@�@�@���@�/�/��/�/�/�/�
/�/��/�/�/�/�/�/r