golden hour
/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/validate/__pycache__
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.cpython-310.pyc
274 B
Del
OK
net.cpython-310.pyc
2.39 KB
Del
OK
path.cpython-310.pyc
1.45 KB
Del
OK
user.cpython-310.pyc
637 B
Del
OK
Edit: path.cpython-310.pyc
o �xe � @ s* d Z ddlZd dd�Zdd� Zdd � ZdS )z� :codeauthor: Pedro Algarvio (pedro@algarvio.me) salt.utils.validate.path ~~~~~~~~~~~~~~~~~~~~~~~~ Several path related validators � NFc C sx t �| t j�rt �| t j�rdS t �| t j�r t �| t j�s dS |du r&dS t j�| �}t �|t j�s5dS t �|t j�S )a Check if a given path is writeable by the current user. :param path: The path to check :param check_parent: If the path to check does not exist, check for the ability to write to the parent directory instead :returns: True or False TF)�os�access�F_OK�W_OK�path�dirname)r Zcheck_parentZ parent_dir� r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/validate/path.py�is_writeable s r c C s$ t �| t j�rt �| t j�rdS dS )z� Check if a given path is readable by the current user. :param path: The path to check :returns: True or False TF)r r r �R_OK�r r r r �is_readable2 s r c C s t �| t j�S )z� Check if a given path is executable by the current user. :param path: The path to check :returns: True or False )r r �X_OKr r r r � is_executableB s r )F)�__doc__r r r r r r r r �<module> s $
Save