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__/cp.cpython-310.pyc
o

�N�g��@s�dZddlZddlZddlZddlZddlZddlZddlZ	ddl
Z	ddlZ	ddlZ	ddl
Z	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlmZddlmZmZmZmZmZe�e�ZdgZdd�Zdd	�Z d
d�Z!dBdd�Z"dd�Z#dd�Z$	dCdd�Z%dd�Z&dDdd�Z'dEdd�Z(dFdd�Z)dGd d!�Z*dHd"d#�Z+dGd$d%�Z,dGd&d'�Z-	dCd(d)�Z.dGd*d+�Z/d,d-�Z0dGd.d/�Z1dId0d1�Z2dId2d3�Z3dId4d5�Z4dGd6d7�Z5dGd8d9�Z6dGd:d;�Z7dJd<d=�Z8dKd>d?�Z9dLd@dA�Z:dS)Mz#
Minion side functions for salt-cp
�N)�CommandExecutionError)�__context__�__file_client__�
__grains__�__opts__�
__pillar__�*cCs dtvrtj�t�td<tdS)z 
    Return the auth object
    �auth)r�saltZcryptZSAuthr�rr�C/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/cp.py�_auth$sr
cCsHtjjtt��tdtd||d�}|��}|r"t|t�r"|�	|�|S)zC
    Whenever a state run starts, gather the pillar data fresh
    �id�saltenv)�pillar_override�	pillarenv)
r
�pillarZ
get_pillarrr�valueZcompile_pillar�
isinstance�dict�update)rrr�retrrr�_gather_pillar-s�
rc	Cs�i}|��D]k\}}tj�|�tj�|�krtj�|�s|}n"tj�|�r1tj�|tj�|��}ntj�tj�|��r>|}ndSz#tjj	�
|d��
}|�|�Wd�n1sZwYd||<Wqtyqd||<Yqw|S)z�
    Used with salt-cp, pass the files dict, and the destination.

    This function receives small fast copy files from the master via salt-cp.
    It does not work via the CLI.

    CLI Example:

    .. code-block:: bash

        salt '*' cp.recv
    zDestination unavailable�w+NTF)
�items�os�path�basename�isdir�join�dirnamer
�utils�files�fopen�write�OSError)r"�destrr�data�final�fp_rrr�recv?s$
$��r*FTc
Cs�dtvrdtd<dd�}|durLzt�|�WdStyK}z'|jtjkr4tj�|�r3WYd}~dSn|t|��WYd}~SWYd}~dSd}~wwt	�
|�}|rUdnd	}z
tjj
�||�}WnVty�}zJ|jtjkr{|t|��WYd}~Szt�tj�|��Wnty�}	z|t|	��WYd}	~	WYd}~Sd}	~	wwtjj
�||�}WYd}~nd}~wwz�z|�|r�tjj�|�n|�Wn(ty�}z|t|��WYd}~Wz|��WSty�YSwd}~ww|�s+|du�r+t�d
||�zt�||�Wn!t�y*|t|��YWz|��WSt�y)YSwwWz|��WdSt�y>YdSwz|��Wwt�yOYww)z�
    This function receives files copied to the minion using ``salt-cp`` and is
    not intended to be used directly on the CLI.

    CLI Example:

    .. code-block:: bash

        salt '*' cp.recv_chunked
    �retcodercSsdtd<|S)N�r+)r)�msgrrr�_erroroszrecv_chunked.<locals>._errorNzPath exists and is a fileT�ab�wbzSetting mode for %s to %s)rr�makedirsr%�errnoZEEXISTr�isfile�str�base64�	b64decoder
r!r"r#�ENOENTr r$Z	gzip_utilZ
uncompress�close�AttributeError�log�debug�chmod)
r&�chunk�append�
compressed�moder.�excZ	open_modeZfh_Zmakedirs_excrrr�recv_chunkedas���
���
$���� 
��������rBcCstrt��Stj�t���S)z�
    Return a file client

    If the __file_client__ context is set return it, otherwize create a new
    file client using __opts__.
    )rrr
Z
fileclientZget_file_clientrrrrr�_client�srCcs��s||fS�tjjjvrtd�����i�t�d<d|vs"d|vr6|�dt�d��}t||�d���d<nt	�d<t
�d<t�d<|�d<��fdd	�}||�}||�}||fS)
z�
    Process markup in the :param:`path` and :param:`dest` variables (NOT the
    files under the paths they ultimately point to) according to the markup
    format provided by :param:`template`.
    z7Attempted to render file paths with unavailable engine r
rr�grains�optsrcs�tjj��}tjj�|d��}|�tjj�|��Wd�n1s#wYtjjj	�|fddi���}tjj�
|�|dsKtd�|d���|dS)z�
        Render :param:`contents` into a literal pathname by writing it to a
        temp file, rendering that file, and returning the result.
        rN�to_strT�resultz)Failed to render file path with error: {}r')
r
r!r"Zmkstempr#r$�stringutilsrF�	templates�TEMPLATE_REGISTRYZsafe_rmr�format)�contentsZtmp_path_fnr)r'��kwargs�templaterr�_render�s"�����z"_render_filenames.<locals>._render)r
r!rIrJr�__salt__�getrrrr)rr&rrO�kwrrPrrMr�_render_filenames�s&�rTc	Ks�|stdpd}t||||fi|��\}}tjj�|�\}}|r"|}t||�s)dSt��}|�|||||�Wd�S1s@wYdS)a�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    .. versionchanged:: 2018.3.0
        ``dest`` can now be a directory

    Used to get a single file from the salt master

    CLI Example:

    .. code-block:: bash

        salt '*' cp.get_file salt://path/to/file /minion/dest

    Template rendering can be enabled on both the source and destination file
    names like so:

    .. code-block:: bash

        salt '*' cp.get_file "salt://{{grains.os}}/vimrc" /etc/vimrc template=jinja

    This example would instruct all Salt minions to download the vimrc from a
    directory with the same name as their os grain and copy it to /etc/vimrc

    For larger files, the cp.get_file module also supports gzip compression.
    Because gzip is CPU-intensive, this should only be used in scenarios where
    the compression ratio is very high (e.g. pretty-printed JSON or YAML
    files).

    Use the *gzip* named argument to enable it.  Valid values are 1..9, where 1
    is the lightest compression and 9 the heaviest.  1 uses the least CPU on
    the master (and minion), 9 uses the most.

    There are two ways of defining the fileserver environment (a.k.a.
    ``saltenv``) from which to retrieve the file. One is to use the ``saltenv``
    parameter, and the other is to use a querystring syntax in the ``salt://``
    URL. The below two examples are equivalent:

    .. code-block:: bash

        salt '*' cp.get_file salt://foo/bar.conf /etc/foo/bar.conf saltenv=config
        salt '*' cp.get_file salt://foo/bar.conf?saltenv=config /etc/foo/bar.conf

    .. note::
        It may be necessary to quote the URL when using the querystring method,
        depending on the shell being used to run the command.
    r�base�N)	rrTr
r!�url�	split_env�	hash_filerC�get_file)	rr&rr1rO�gziprN�senv�clientrrrrZ�s3
$�rZcCs2t��}|��Wd�S1swYdS)zz
    List available environments for fileserver

    CLI Example:

    .. code-block:: bash

        salt '*' cp.envs
    N)rC�envs)r]rrrr^*s
$�r^�jinjacKs�|stdpd}d|vrt|d<d|vrt|d<d|vr t|d<d|vr(t|d<t��}|j|||||fi|��Wd�S1sCwYdS)ah
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Render a file as a template before setting it down.
    Warning, order is not the same as in fileclient.cp for
    non breaking old API.

    CLI Example:

    .. code-block:: bash

        salt '*' cp.get_template salt://path/to/template /minion/dest
    rrUr
rrDrEN)rrQrrrC�get_template)rr&rOrr1rNr]rrrr`8s$�r`cKsd|stdpd}t||||fi|��\}}t��}|�||||�Wd�S1s+wYdS)aX
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Used to recursively copy a directory from the salt master

    CLI Example:

    .. code-block:: bash

        salt '*' cp.get_dir salt://path/to/dir/ /minion/dest

    get_dir supports the same template and gzip arguments as get_file.
    rrUN)rrTrC�get_dir)rr&rrOr[rNr]rrrraVs$�rarVc	Cs�|stdpd}t|t�r+t��}|j|||||d�}Wd�n1s%wYnt��}|j|d||d|d�}Wd�n1sDwY|sWt�dtjj	�
|�|�|r`tjj�|�S|S)a�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    .. versionchanged:: 2018.3.0
        ``dest`` can now be a directory

    Used to get a single file from a URL.

    path
        A URL to download a file from. Supported URL schemes are: ``salt://``,
        ``http://``, ``https://``, ``ftp://``, ``s3://``, ``swift://`` and
        ``file://`` (local filesystem). If no scheme was specified, this is
        equivalent of using ``file://``.
        If a ``file://`` URL is given, the function just returns absolute path
        to that file on a local filesystem.
        The function returns ``False`` if Salt was unable to fetch a file from
        a ``salt://`` URL.

    dest
        The default behaviour is to write the fetched file to the given
        destination path. If this parameter is omitted or set as empty string
        (``''``), the function places the remote file on the local filesystem
        inside the Minion cache directory and returns the path to that file.

        .. note::

            To simply return the file contents instead, set destination to
            ``None``. This works with ``salt://``, ``http://``, ``https://``
            and ``file://`` URLs. The files fetched by ``http://`` and
            ``https://`` will not be cached.

    saltenv
        Salt fileserver environment from which to retrieve the file. Ignored if
        ``path`` is not a ``salt://`` URL.

    source_hash
        If ``path`` is an http(s) or ftp URL and the file exists in the
        minion's file cache, this option can be passed to keep the minion from
        re-downloading the file if the cached copy matches the specified hash.

        .. versionadded:: 2018.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' cp.get_url salt://my/file /tmp/this_file_is_mine
        salt '*' cp.get_url http://www.slashdot.org /tmp/index.html
    rrU)�source_hashNT)Zno_cacherbz(Unable to fetch file %s from saltenv %s.)
rrr4rC�get_urlr:�errorr
r!rWZredact_http_basic_authrH�
to_unicode)rr&rr1rbr]rGrrrrcns.3

������rccCs�|stdpd}t||�}t|t�rBz%tjj�|d��}tjj�	|�
��Wd�WS1s0wYW|StyAYdSw|S)aq
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Download a file from a URL to the Minion cache directory and return the
    contents of that file

    Returns ``False`` if Salt was unable to cache a file from a URL.

    CLI Example:

    .. code-block:: bash

        salt '*' cp.get_file_str salt://my/file
    rrU�rNF)r�
cache_filerr4r
r!r"r#rHre�readr%)rrZfn_r)rrr�get_file_str�s

$���ric
Cs|stdpd}tjj�|�}tjj�|�}d�d||�}tj�|�j	tjj
jv}z|rB|tvrBt
j�t|�r=t|WSt�|�Wn	tyLYnwtjj�|�\}}|rZ|}t��}|j|||||d�}	Wd�n1srwY|	s�|s�t�d||�|r�|	t|<|	S)ai
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Used to cache a single file on the Minion

    Returns the location of the new cached file on the Minion

    source_hash
        If ``name`` is an http(s) or ftp URL and the file exists in the
        minion's file cache, this option can be passed to keep the minion from
        re-downloading the file if the cached copy matches the specified hash.

        .. versionadded:: 2018.3.0

    verify_ssl
        If ``False``, remote https file sources (``https://``) and source_hash
        will not attempt to validate the servers certificate. Default is True.

        .. versionadded:: 3002

    use_etag
        If ``True``, remote http/https file sources will attempt to use the
        ETag header to determine if the remote file needs to be downloaded.
        This provides a lightweight mechanism for promptly refreshing files
        changed on a web server without requiring a full hash comparison via
        the ``source_hash`` parameter.

        .. versionadded:: 3005

    CLI Example:

    .. code-block:: bash

        salt '*' cp.cache_file salt://path/to/file

    There are two ways of defining the fileserver environment (a.k.a.
    ``saltenv``) from which to cache the file. One is to use the ``saltenv``
    parameter, and the other is to use a querystring syntax in the ``salt://``
    URL. The below two examples are equivalent:

    .. code-block:: bash

        salt '*' cp.cache_file salt://foo/bar.conf saltenv=config
        salt '*' cp.cache_file salt://foo/bar.conf?saltenv=config

    If the path being cached is a ``salt://`` URI, and the path does not exist,
    then ``False`` will be returned.

    .. note::
        It may be necessary to quote the URL when using the querystring method,
        depending on the shell being used to run the command.
    rrUz{}_|-{}_|-{}z
cp.cache_file)rb�
verify_ssl�use_etagNz,Unable to cache file '%s' from saltenv '%s'.)rr
r!r'�decoderK�urllib�parse�urlparse�schemer"Z
REMOTE_PROTOSrrrr3�popr9rWrXrCrgr:rd)
rrrbrjrkZ
contextkeyZpath_is_remoter\r]rGrrrrg�sB6�

����rgcC�F|stdpd}t��}|�||�Wd�S1swYdS)a�
    .. versionadded:: 3000

    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Returns the expected cache path for the file, if cached using
    :py:func:`cp.cache_file <salt.modules.cp.cache_file>`.

    .. note::
        This only returns the _expected_ path, it does not tell you if the URL
        is really cached. To check if the URL is cached, use
        :py:func:`cp.is_cached <salt.modules.cp.is_cached>` instead.

    CLI Examples:

    .. code-block:: bash

        salt '*' cp.cache_dest https://foo.com/bar.rpm
        salt '*' cp.cache_dest salt://my/file
        salt '*' cp.cache_dest salt://my/file saltenv=dev
    rrUN)rrC�
cache_dest)rWrr]rrrrs>s

$�rscCrr)a�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Used to gather many files from the Master, the gathered files will be
    saved in the minion cachedir reflective to the paths retrieved from the
    Master

    CLI Example:

    .. code-block:: bash

        salt '*' cp.cache_files salt://pathto/file1,salt://pathto/file1

    There are two ways of defining the fileserver environment (a.k.a.
    ``saltenv``) from which to cache the files. One is to use the ``saltenv``
    parameter, and the other is to use a querystring syntax in the ``salt://``
    URL. The below two examples are equivalent:

    .. code-block:: bash

        salt '*' cp.cache_files salt://foo/bar.conf,salt://foo/baz.conf saltenv=config
        salt '*' cp.cache_files salt://foo/bar.conf?saltenv=config,salt://foo/baz.conf?saltenv=config

    The querystring method is less useful when all files are being cached from
    the same environment, but is a good way of caching files from multiple
    different environments in the same command. For example, the below command
    will cache the first file from the ``config1`` environment, and the second
    one from the ``config2`` environment.

    .. code-block:: bash

        salt '*' cp.cache_files salt://foo/bar.conf?saltenv=config1,salt://foo/bar.conf?saltenv=config2

    .. note::
        It may be necessary to quote the URL when using the querystring method,
        depending on the shell being used to run the command.
    rrUN)rrC�cache_files)�pathsrr]rrrrt[s
'
$�rtcCsL|stdpd}t��}|�|||||�Wd�S1swYdS)a,
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Download and cache everything under a directory from the master


    include_pat : None
        Glob or regex to narrow down the files cached from the given path. If
        matching with a regex, the regex must be prefixed with ``E@``,
        otherwise the expression will be interpreted as a glob.

        .. versionadded:: 2014.7.0

    exclude_pat : None
        Glob or regex to exclude certain files from being cached from the given
        path. If matching with a regex, the regex must be prefixed with ``E@``,
        otherwise the expression will be interpreted as a glob.

        .. note::

            If used with ``include_pat``, files matching this pattern will be
            excluded from the subset of files defined by ``include_pat``.

        .. versionadded:: 2014.7.0

    CLI Examples:

    .. code-block:: bash

        salt '*' cp.cache_dir salt://path/to/dir
        salt '*' cp.cache_dir salt://path/to/dir include_pat='E@*.py$'
    rrUN)rrC�	cache_dir)rrZ
include_emptyZinclude_patZexclude_patr]rrrrv�s
$$�rvcC�D|stdpd}t��
}|�|�Wd�S1swYdS)z�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Retrieve all of the files on the master and cache them locally

    CLI Example:

    .. code-block:: bash

        salt '*' cp.cache_master
    rrUN)rrC�cache_master�rr]rrrrx��

$�rxcCsttj�|�sdSt|�}|r t|�}t|�}|d|dkr |St��
}|�|�Wd�S1s3wYdS)z�
    Cache a local file on the minion in the localfiles cache

    CLI Example:

    .. code-block:: bash

        salt '*' cp.cache_local_file /etc/hosts
    rVZhsumN)rr�exists�	is_cachedrYrC�cache_local_file)rZpath_cachedZ	path_hashZpath_cached_hashr]rrrr}�s
$�r}cCrw)z�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    List all of the available state modules in an environment

    CLI Example:

    .. code-block:: bash

        salt '*' cp.list_states
    rrUN)rrC�list_statesryrrrr~�rzr~cC�F|stdpd}t��}|�||�Wd�S1swYdS)z�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    List all of the files stored on the master

    CLI Example:

    .. code-block:: bash

        salt '*' cp.list_master
    rrUN)rrCZ	file_list�r�prefixr]rrr�list_master��


$�r�cCr)z�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    List all of the directories stored on the master

    CLI Example:

    .. code-block:: bash

        salt '*' cp.list_master_dirs
    rrUN)rrCZdir_listr�rrr�list_master_dirsr�r�cCr)z�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    List all of the symlinks stored on the master

    CLI Example:

    .. code-block:: bash

        salt '*' cp.list_master_symlinks
    rrUN)rrCZsymlink_listr�rrr�list_master_symlinksr�r�cCrw)z�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    List all of the files cached on the minion

    CLI Example:

    .. code-block:: bash

        salt '*' cp.list_minion
    rrUN)rrCZfile_local_listryrrr�list_minion-rzr�cC�`|stdpd}tjj�|�\}}|r|}t��}|�||�Wd�S1s)wYdS)a6
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Returns the full path to a file if it is cached locally on the minion
    otherwise returns a blank string

    CLI Example:

    .. code-block:: bash

        salt '*' cp.is_cached salt://path/to/file
    rrUN)rr
r!rWrXrCr|�rrr\r]rrrr|@s
$�r|cCr�)a�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Return the hash of a file, to get the hash of a file on the
    salt master file server prepend the path with salt://<file on server>
    otherwise, prepend the file with / for a local file.

    CLI Example:

    .. code-block:: bash

        salt '*' cp.hash_file salt://path/to/file
    rrUN)rr
r!rWrXrCrYr�rrrrYYs
$�rYcCs�|stdpd}tjj�|�\}}|r|}t��}|�||�d}Wd�n1s+wY|dur6|S|durCtjj�|d�S|dS)a�
    .. versionchanged:: 3005
        ``saltenv`` will use value from config if not explicitly set

    Return the permissions of a file, to get the permissions of a file on the
    salt master file server prepend the path with salt://<file on server>
    otherwise, prepend the file with / for a local file.

    CLI Example:

    .. code-block:: bash

        salt '*' cp.stat_file salt://path/to/file
    rrUr,NTr)	rr
r!rWrXrCZhash_and_stat_filer"Zst_mode_to_octal)rrZoctalr\r]�statrrr�	stat_filess�"r�c
Cs6t�d|�d|vstj�|�st�d�dS|stj�|�}tj�|�s,t�d�dSt�}|rId|vrBt�d�t�d|�dS|�tj	�}n|�tj	�}tj�
|�}tj�|�d}dd	�|�tj	�D�}d
t
d|tj�|�|�d�d
�}	tjjj�t
���}
tjj�|d��u}d}	|��|	d<|�t
d�|	d<|	ds�|r�|r�ztjj�|�t�d|�Wnty�t�d|�YWd�Wd�dSw	Wd�Wd�dS|
�|	�}
|
s�t�d�|
Wd�Wd�Sd}q�1�swYWd�dS1�swYdS)a,
    WARNING Files pushed to the master will have global read permissions..

    Push a file from the minion up to the master, the file will be saved to
    the salt master in the master's minion files cachedir
    (defaults to ``/var/cache/salt/master/minions/minion-id/files``)

    Since this feature allows a minion to push a file up to the master server
    it is disabled by default for security purposes. To enable, set
    ``file_recv`` to ``True`` in the master configuration file, and restart the
    master.

    keep_symlinks
        Keep the path value without resolving its canonical form

    upload_path
        Provide a different path inside the master's minion files cachedir

    remove_source
        Remove the source file on the minion

        .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' cp.push /etc/fstab
        salt '*' cp.push /etc/system-release keep_symlinks=True
        salt '*' cp.push /etc/fstab upload_path='/new/path/fstab'
        salt '*' cp.push /tmp/filename remove_source=True
    zTrying to copy '%s' to master�../z&Path must be absolute, returning FalseFz1Path failed os.path.isfile check, returning FalsezBad path: %sr,cSsg|]}|r|�qSrr)�.0Z_frrr�
<listcomp>�szpush.<locals>.<listcomp>Z
_file_recvrssalt)�cmdrr�size�tok�rbT�locZfile_buffer_sizer'zRemoving source file '%s'z"cp.push failed to remove file '%s'Nz�cp.push Failed transfer failed. Ensure master has 'file_recv' set to 'True' and that the file is not larger than the 'file_recv_size_max' setting on the master.)r:r;rr�isabs�realpathr3r
�lstrip�sep�normpath�
splitdrive�splitr�getsizeZ	gen_tokenr
�channelr]Z
ReqChannel�factoryr!r"r#�tellrhZrm_rfr%rd�send)rZ
keep_symlinks�upload_pathZ
remove_sourcer	Z	load_pathZload_path_normalZload_path_split_driveZload_path_list�loadr�r)Z	init_sendrrrr�push�st!



�����
�����$�r�c		s�d|vs
tj�|�sdS|}tj�|�}tj�|�r t||d�Sg}tjj�|�D]\�}}|�fdd�|D�7}q)�durG�fdd�|D�}|sKdS|D]-}|rn|�	|�rntj�
tjj|�tjj�|�
|d��tjj��}t||d�}|sz|SqMd	S)
ar
    Push a directory from the minion up to the master, the files will be saved
    to the salt master in the master's minion files cachedir (defaults to
    ``/var/cache/salt/master/minions/minion-id/files``).  It also has a glob
    for matching specific files using globbing.

    .. versionadded:: 2014.7.0

    Since this feature allows a minion to push files up to the master server it
    is disabled by default for security purposes. To enable, set ``file_recv``
    to ``True`` in the master configuration file, and restart the master.

    upload_path
        Provide a different path and directory name inside the master's minion
        files cachedir

    CLI Example:

    .. code-block:: bash

        salt '*' cp.push /usr/lib/mysql
        salt '*' cp.push /usr/lib/mysql upload_path='/newmysql/path'
        salt '*' cp.push_dir /etc/modprobe.d/ glob='*.conf'
    r�F)r�csg|]	}tj��|��qSr)rrr)r��tmpfile)�rootrrr�szpush_dir.<locals>.<listcomp>Ncs$g|]}t�tj�|���r|�qSr)�fnmatchrrr)r��fi)�globrrr�s
��rVT)rrr�r�r3r�r
r!Zos_walk�
startswithrr��strip�replace)	rr�r�Ztmpupload_pathZfilelist�_r"r�rr)r�r�r�push_dir�s6
���r�)FTN)NFNN)r_NF)NNN)rVNFN)N)NNTF)NrV)NT)FNF)NN);�__doc__r5r2r��loggingr�urllib.parsermZsalt.channel.clientr
Z
salt.cryptZsalt.fileclientZsalt.minionZsalt.utils.dataZsalt.utils.filesZsalt.utils.gzip_utilZsalt.utils.pathZsalt.utils.templatesZsalt.utils.urlZsalt.exceptionsrZsalt.loader.dunderrrrrr�	getLogger�__name__r:Z__proxyenabled__r
rr*rBrCrTrZr^r`rarcrirgrsrtrvrxr}r~r�r�r�r�r|rYr�r�r�rrrr�<module>sf
	
"F5
�C



L

g
.
�
*








a