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/modules/__pycache__/moosefs.cpython-310.pyc
o

�N�g~�@s<dZddlZdd�Zd
dd�Zdd�Zd	d
�Zd
dd�ZdS)z=
Module for gathering and managing information about MooseFS
�NcCstjj�d�r	dSdS)z5
    Only load if the mfs commands are installed
    �
mfsgetgoalZmoosefs)FzXThe moosefs execution module cannot be loaded: the mfsgetgoal binary is not in the path.)�salt�utils�path�which�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/moosefs.py�__virtual__sr	cCsvd}i}|r|d|7}|d|7}td|dd�}|d��}|D]}|s'q"|�d�}|d	��||d
��<q"|S)z�
    Return information on a directory located on the Moose

    CLI Example:

    .. code-block:: bash

        salt '*' moosefs.dirinfo /path/to/dir/ [-[n][h|H]]
    Z
mfsdirinfo� -� �cmd.run_allF�Zpython_shell�stdout�:�r)�__salt__�
splitlines�split�strip)r�opts�cmd�ret�out�output�line�compsrrr�dirinfos

rcCsd|}i}d}td|dd�}|d��}|D]r}|sqd|vre|�d�}|d���d	�}|d
���d�}|d�dd�}	|d
��}
|d�d
d�}|d
�dd��dd�}|	|
||d�||d<d|vr�|���d	�}
|
d�dd�|
d
��|
dd�||d|
d<q|S)z�
    Return information on a file located on the Moose

    CLI Example:

    .. code-block:: bash

        salt '*' moosefs.fileinfo /path/to/dir/
    zmfsfileinfo �rFr
r�/rrrrzchunk z(id:�)zver:)�chunk�loc�id�ver�copyzcopy �)r$�ip�port)rrrr�replace)rrrZchunknumrrrr�metar r!Zid_r#Zcopyinforrr�fileinfo/s:

�
��r*cCs�d}i}td|�}|d��}|D]A}|sqd|vrS|�d�}|d�d�}|d�d	�}|d|dd	|dd
�|d|d�d
d��dd��d�d�||d<q|S)z~
    Return a list of current MooseFS mounts

    CLI Example:

    .. code-block:: bash

        salt '*' moosefs.mounts
    Zmountrrzfuse.mfsrrrrr)Zmasterr'Z	subfolderr%��(rr�,)Zremote�local�options)rrrr()rrrrrrZinfo1Zinfo2rrr�mounts]s(


���	r0c
Cs�d}i}|r
|d|7}nd}|d|7}td|dd�}|d��}d	|vr6|d
�d�}d|d
i}|S|D]&}|s=q8||vrBq8|��}|d
d}	|	|vrTi||	<|d||	|d<q8|S)z�
    Return goal(s) for a file or directory

    CLI Example:

    .. code-block:: bash

        salt '*' moosefs.getgoal /path/to/file [-[n][h|H]]
        salt '*' moosefs.getgoal /path/to/dir/ [-[n][h|H][r]]
    rr
rrrFr
r�rrz: �goalrz
 with goalr+�)rrr)
rrrrrrr2rrZkeytextrrr�getgoals0��r4)N)�__doc__Zsalt.utils.pathrr	rr*r0r4rrrr�<module>s

."