HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/mount.cpython-310.pyc
o

�N�g��@sbdZddlZddlZddlZddlZddlZddlZe�e	�Z
dd�Zdd�Zdd�Z
d	d
�ZdS)z&
Common functions for managing mounts
�NcCs^z#tjj�|d��}tjj�|�Wd�WS1swYWdSty.iYSw)z7
    Reads and returns the contents of a text file
    �rbN)�salt�utils�files�fopen�yamlZ	safe_load�OSError)�path�contents�r�D/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/mount.py�
_read_files(��r
cCstj�|dd�S)z/
    Return the mount cache file location.
    ZcachedirZmounts)�osr	�join)�optsrrr�	get_cachesrcCst|�}t|�S)�%
    Write the mount cache file.
    )rr
)r�
cache_filerrr�
read_cache"srcCs�t|�}z.tjj�tjj�|��}tjj�|d��}|�	|�Wd�WdS1s+wYWdSt
yDtjdt
jd�YdSw)rzwb+NTzFailed to cache mounts)Zexc_info_on_loglevelF)rrrZstringutils�to_bytesrZ	safe_dumprr�writer�log�error�logging�DEBUG)�cacherr�_cacheZfp_rrr�write_cache*s
���r)�__doc__rrZsalt.utils.filesrZsalt.utils.stringutilsZsalt.utils.versionsZsalt.utils.yaml�	getLogger�__name__rr
rrrrrrr�<module>s