File: //usr/lib/python3/dist-packages/cloudinit/__pycache__/temp_utils.cpython-39.pyc
a
��`z � @ sj d dl Z d dlZd dlZd dlZd dlZdadZdZddd�Zdd� Z e j
dd d
��Zdd� Zd
d� Z
dS )� Nz/run/cloud-init/tmpz/var/tmp/cloud-initFc C s� | dur| S |r:t }tj�|�s6t�|� t�|d� |S trBtS t�� dkrTt}ntj �
dd�}tj�|�s�t�|� t�|d� |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.
Ni� r ZTMPDIRz/tmp)�_EXE_ROOT_TMPDIR�os�path�isdir�makedirs�chmod�_TMPDIR�getuid�_ROOT_TMPDIR�environ�get)Zodir� needs_exe�tdir� r �6/usr/lib/python3/dist-packages/cloudinit/temp_utils.py�_tempfile_dir_arg s$
r c sX t | �dd �| �dd��| d<