File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/fileserver/__pycache__/minionfs.cpython-310.pyc
Back
o ;j3. � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddl Zddl ZddlZe�e �ZdZdd� Zdd� Zdd d �Zdd� Zd d� Zdd� Zdd� Zdd� Zdd� ZdS )a� Fileserver backend which serves files pushed to the Master The :mod:`cp.push <salt.modules.cp.push>` function allows Minions to push files up to the Master. Using this backend, these pushed files are exposed to other Minions via the Salt fileserver. To enable minionfs, :conf_master:`file_recv` needs to be set to ``True`` in the master config file (otherwise :mod:`cp.push <salt.modules.cp.push>` will not be allowed to push files to the Master), and ``minionfs`` must be added to the :conf_master:`fileserver_backends` list. .. code-block:: yaml fileserver_backend: - minionfs .. note:: ``minion`` also works here. Prior to the 2018.3.0 release, *only* ``minion`` would work. Other minionfs settings include: :conf_master:`minionfs_whitelist`, :conf_master:`minionfs_blacklist`, :conf_master:`minionfs_mountpoint`, and :conf_master:`minionfs_env`. .. seealso:: :ref:`tutorial-minionfs` � N�minionfsc C s t td vrdS td rt S dS )z+ Only load if file_recv is enabled Zfileserver_backendFZ file_recv)�__virtualname__�__opts__� r r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/fileserver/minionfs.py�__virtual__1 s r c C s t jjj| td td d�S )zN Check if the minion is exposed, based on the whitelist and blacklist Zminionfs_whitelistZminionfs_blacklist)Z whitelistZ blacklist)�salt�utils�stringutilsZcheck_whitelist_blacklistr )�minionr r r �_is_exposed: s �r �basec K s ddd�}t j�| �r |S |t� vr|S t j�| �dkr$t�d| � |S tjj � td �}| t|�d� � t jj�} z| �t jd�\}}W n tyP | Y S w t|�sW|S t j�td d |d |�}t j�|�r�tj�t|�s�||d<