HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/extmods.cpython-310.pyc
o

�N�g��@s~dZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
mZe�e
�Zdd�Zdd�Z			d
dd	�ZdS)z)
Functions used to sync external modules
�N)�DEFAULT_HASH_TYPEcCs4g}tjj�|�D]\}}}|s|s|�|�q	|S)N)�salt�utils�path�os_walk�append)�rootdir�	emptydirs�root�dirs�files�r
�F/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/extmods.py�_list_emptydirss
�rcCsTg}tjj�|�D]\}}}|D]}tj�||��d�}|�tj�||��qq	|S)N�.)	rrrr�os�relpath�stripr�join)rZ	file_listr
rr�filenamerr
r
r�_listdir_recursivelys�rcCs|durdg}|dur|d}nt|t�r||�d�i}nt|t�s(t�d|�|dur1|d}nt|t�r>||�d�i}nt|t�sIt�d|�t|t�rS|�d�}g}t�}tjj	�
d|�}tj�
|d	|��}d
}	tjj�d�����zXtj�|�s�t�d|�zt�|�Wnty�t�d
|�Ynwtj�|���}
|D]�}t�d||�g}t�d||�|�|
j||d
ddd��tj�
|dd|d|���}
t�d|
�|D]�}tj�||
�}tj�|�d�tjd�}|r�||vr�|||vr�q�|�r||v�r|||v�rq�|�|�tj�
||�}t�d||�tj�|��rR|�dt �}tjj!�"||�}tjj!�"||�}||k�rQt#�$||�|�%|�d|���q�tj�&|�}tj�|��sdt�|�t#�$||�|�%|�d|���q�q�Wd�n	1�s�wYt'|�}	|ddu�r�tt(|��}||D]}tj�
||�}tj�|��r�d}	t�)|��q�	t*|�}|�s�n|D]}d}	t#j+|dd��q��q�Wnt,�y�}z
t�d||�WYd}~nd}~wwWd�||	fSWd�||	fS1�swY||	fS)zB
    Sync custom modules into the extension_modules directory
    N�base�extmod_whitelist�,z3extmod_whitelist must be a string or dictionary: %s�extmod_blacklistz3extmod_blacklist must be a string or dictionary: %s�_Zextension_modulesF�?zCreating module dir '%s'z;Cannot create cache module directory %s. Check permissions.zSyncing %s for environment '%s'zLoading cache from %s, for %szE@\.(pyx?|so|zip)$)Z
include_emptyZinclude_patZexclude_patZcachedirrzLocal cache dir: '%s'rrzCopying '%s' to '%s'�	hash_typeZclean_dynamic_modulesT)�
ignore_errorszFailed to sync %s module: %s)-�
isinstance�str�split�dict�log�error�setrr�url�createrrrrZ	set_umask�isdir�info�makedirs�OSError�
fileclientZget_file_client�extendZ	cache_dir�debugr�splitext�replace�sep�add�isfile�getrZ	hashutilsZget_hash�shutil�copyfiler�dirname�boolr�remover�rmtree�	Exception)�optsZformZsaltenvrr�retZremote�sourceZmod_dirZtouchedr,Zsub_env�cacheZlocal_cache_dirZfn_rZrelname�destrZ
src_digestZ
dst_digestZdest_dir�current�fullr	Zemptydir�excr
r
r�sync$s�



�


�

����	���


�
���5
������
�R�
�R�RrD)NNN)�__doc__�loggingrr5Zsalt.fileclientrZsalt.utils.filesZsalt.utils.hashutilsZsalt.utils.pathZsalt.utils.urlZsalt.configr�	getLogger�__name__r#rrrDr
r
r
r�<module>s"
�