HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //proc/self/root/lib/python3.9/site-packages/ipaclient/plugins/__pycache__/automount.cpython-39.pyc
a

}�f�)�@sddlZddlZddlmZddlmZmZddlmZmZddl	m
Z
mZmZddl
mZddlmZddlmZdd	lmZejr�eZe�Zd
ZdZedd
�Gdd�de��Zedd
�Gdd�de��Zeddd�Gdd�de��Ze�Gdd�de
��ZdS)�N)�MethodOverride)�api�errors)�Flag�Str)�Command�Method�Object)�Registry)�
classproperty)�_)�DN)zauto.direct)z/-T)�no_failc@seZdZdZdS)�_fake_automountlocationZautomountlocationN)�__name__�
__module__�__qualname__�name�rr�?/usr/lib/python3.9/site-packages/ipaclient/plugins/automount.pyr+src@seZdZdZdZdS)�_fake_automountlocation_show�automountlocation_showTN)rrrr�NO_CLIrrrrr0sr)�overriderc@s4eZdZedd��Zee�Zedd��Zdd�Z	dS)�automountlocation_tofilescCstj�d�tuS)Nr)rrZ
get_pluginr)�clsrrrZ__NO_CLI_getter8s
�z)automountlocation_tofiles.__NO_CLI_gettercCs|jjjjS�N)rrr�api_version)�selfrrrr?sz%automountlocation_tofiles.api_versionc
	Os�|dd}|dd}|dd}|dd}|�d�|D]\}|dd�d	�rx|�d
|dd|ddf�q>|�d|dd|ddf�q>|D]l}|dd�d	�r�q�|dd}	|�d
�|�d|	�||	D]&}
|�d
|
dd|
ddf�q�q�|�d�|�td��|D]�}|�d
�|�d|d�|D]h}
t|
�dk�rd�qN|
D]J}t|d�}|d|ddk�rh|�d
|dd|ddf��qh�qN�q*dS)N�result�maps�keys�
orphanmaps�
orphankeysz/etc/auto.master:�automountinformationr�-z%s	%s�automountkeyz
%s	/etc/%sz---------------------------z/etc/%s:�z'maps not connected to /etc/auto.master:Zautomountmapname�dn)�print_plain�
startswithr�lenr
)
r�textuirr!�optionsr r"r#�m�info�k�keyr(rrr�output_for_cliCsZ
����
��



��z(automountlocation_tofiles.output_for_cliN)
rrr�classmethodZ)_automountlocation_tofiles__NO_CLI_getterrr�propertyrr2rrrrr6s

rcsheZdZed�Zeded�ed�d�fZedded�d	�fZ�fd
d�Z	dd
�Z
dd�Zdd�Z�Z
S)�automountlocation_importz/Import automount files for a specific location.Z
masterfilezMaster filezAutomount master file.)Zlabel�docz	continue?�continuezIContinuous operation mode. Errors are reported but the process continues.)Zcli_namer6c#s8|jjj��D]
}|Vqtt|���D]
}|Vq(dSr)rrr�args�superr5�get_args)r�arg��	__class__rrr:�sz!automountlocation_import.get_argsc
Csnzt|d�}|��}|��WnJtyh}z2|jdkrRtjtd�d|id��n�WYd}~n
d}~00|S)N�r�zFile %(file)s not found�file)�reason)�open�	readlines�close�IOError�errnorZNotFoundr)r�filename�fp�map�errrZ__read_mapfile�s

�z'automountlocation_import.__read_mapfilecOs�|jjd|d�gggggd�}i}|�|d�}|D�]}|�d�rLq:|��}|�d�rv|d�||dg�q:t|�dkr�q:|�d�}t|�d	kr�q:|d�d
�r�|d�dd�}t	j
�|d�|d<|||d<zNtjd
|ddt|d�td�
|dd���d�|d�|ddg�Wnjtj�y�t|d�tv�rNn@|�dd��rp|d�|d�ntjtd�t|dd�d��Yn0|d�d�s:z2tjd|dt|d��|d�|d�Wq:tj�y>t|d�tv�r�n@|�dd��r|d�|d�ntjtd�t|dd�d��Yq:0q:|��D�]h\}}	|�|	�}
g}d}|
D]�}
|
�d��r~�qj|
��}
|
�d��r�|d�||	g��qjt|
�dk�r��qj|
�d��r�||
dd�d}n|�||
�d}�qj|D]�}
|
�d�}t|d�dd��}zFtjd
|dt|�|td�
|dd���d�|d�||g�WnNtj�y�}z2|�dd��r�|d�|d�n|�WYd}~n
d}~00�q��qJt|d �S)!z�
        The basic idea is to read the master file and create all the maps
        we need, then read each map file and add all the keys for the map.
        rr)r r!�skipped�
duplicatekeys�
duplicatemaps��#�+rKNr?�/�"r'Zautomountkey_addzauto.master� )r&r$r!r7FrLzkey %(key)s already exists�r1)�messager%Zautomountmap_addr rMzmap %(map)s already exists�rI�\���)r)rr�'_automountlocation_import__read_mapfiler*�rstrip�appendr+�split�replace�os�path�basename�unicode�joinrZDuplicateEntry�DEFAULT_KEYS�getr�dict�DEFAULT_MAPS�items�endswith)rr8r-rr Zmasterr.�amZmapfilerGrI�linesZcont�xr1rJrrr�forward�s�




�����

�"z automountlocation_import.forwardcOs�|dd}|dd}|dd}|dd}|dd}|�td��|D]}	|�td�t|	d	��qN|�d
�|�td��|D]&}
|�td�t|
d
|
dd��q�|�d
�t|�d
k�r|�td��|D]&}
|�td�t|
d
|
dd��q�|�dd��rZt|�d
k�rZ|�d
�|�td��|D]}	|�td�t|	d	���q:|�dd��r�t|�d
k�r�|�d
�|�td��|D]}
|�td�t|
d���q�dS)Nrr r!rMrLrKzImported maps:z
Added %(map)srVr'zImported keys:zAdded %(src)s to %(dst)srrN)�src�dstz
Ignored keys:zIgnored %(src)s to %(dst)sr7FzDuplicate maps skipped:zSkipped %(map)szDuplicate keys skipped:zSkipped %(key)srT)r)rrer+rd)rr,rr!r-r rMrLrKr.r0rrrr2sR�
��
��
�
�z'automountlocation_import.output_for_cli)rrrr�__doc__rZ
takes_argsrZ
takes_optionsr:rYrlr2�
__classcell__rrr<rr5vs����er5)r^ZsixZipaclient.frontendrZipalibrrrrZipalib.frontendrrr	Zipalib.plugabler
Zipalib.utilrrZipapython.dnr
ZPY3�strra�registerrfrcrrrr5rrrr�<module>s,
?