%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/scp_mod.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlmZy"ddl	Z	ddl
Z
eZWne
k
r�eZnXdgZdZeje�Zd�Zd�Zd	�Zd
eed�Zdeedd
�ZdS(ur
SCP Module
==========

.. versionadded:: 2019.2.0

Module to copy files via `SCP <https://man.openbsd.org/scp>`_
i(tabsolute_importtprint_functiontunicode_literalsN(tsixu*uscpcC@ststdfStS(Nu4Please install SCP for this modules: pip install scp(tHAS_SCPtFalset__virtualname__(((s8/usr/lib/python2.7/site-packages/salt/modules/scp_mod.pyt__virtual__ s
cK@s�i}i}tjtjj�\}}}}|jd�|jd�tjtjj	�\}}}}|jd�|jd�xgt
j|�D]V\}}||kr�|dk	r�|||<n||kr�|dk	r�|||<q�q�W||fS(Niuauto_add_policy(
tinspectt
getargspectparamikot	SSHClienttconnecttpoptappendtscpt	SCPClientt__init__Rt	iteritemstNone(tkwargstparamiko_kwargst
scp_kwargstPARAMIKO_KWARGSt_t
SCP_KWARGStkargtwarg((s8/usr/lib/python2.7/site-packages/salt/modules/scp_mod.pyt_select_kwargs&s!

!


cK@sot|�\}}tj�}|jdt�rF|jtj��n|j|�tj	|j
�|�}|S(uG
    Prepare the underlying SSH connection with the remote target.
    uauto_add_policy(RR
RR
Rtset_missing_host_key_policyt
AutoAddPolicyRRRt
get_transport(RRRtssht
scp_client((s8/usr/lib/python2.7/site-packages/salt/modules/scp_mod.pyt_prepare_connection7s
	ucK@sCt|�}i|d6|d6}|r3||d<n|j||�S(u�
    Transfer files and directories from remote host to the localhost of the
    Minion.

    remote_path
        Path to retrieve from remote host. Since this is evaluated by scp on the
        remote host, shell wildcards and environment variables may be used.

    recursive: ``False``
        Transfer files and directories recursively.

    preserve_times: ``False``
        Preserve ``mtime`` and ``atime`` of transferred files and directories.

    hostname
        The hostname of the remote device.

    port: ``22``
        The port of the remote device.

    username
        The username required for SSH authentication on the device.

    password
        Used for password authentication. It is also used for private key
        decryption if ``passphrase`` is not given.

    passphrase
        Used for decrypting private keys.

    pkey
        An optional private key to use for authentication.

    key_filename
        The filename, or list of filenames, of optional private key(s) and/or
        certificates to try for authentication.

    timeout
        An optional timeout (in seconds) for the TCP connect.

    socket_timeout: ``10``
        The channel socket timeout in seconds.

    buff_size: ``16384``
        The size of the SCP send buffer.

    allow_agent: ``True``
        Set to ``False`` to disable connecting to the SSH agent.

    look_for_keys: ``True``
        Set to ``False`` to disable searching for discoverable private key
        files in ``~/.ssh/``

    banner_timeout
        An optional timeout (in seconds) to wait for the SSH banner to be
        presented.

    auth_timeout
        An optional timeout (in seconds) to wait for an authentication
        response.

    auto_add_policy: ``False``
        Automatically add the host to the ``known_hosts``.

    CLI Example:

    .. code-block:: bash

        salt '*' scp.get /var/tmp/file /tmp/file hostname=10.10.10.1 auto_add_policy=True
    u	recursiveupreserve_timesu
local_path(R"tget(tremote_patht
local_patht	recursivetpreserve_timesRR!t
get_kwargs((s8/usr/lib/python2.7/site-packages/salt/modules/scp_mod.pyR#EsK

ubasecK@s�t|�}i|d6|d6}|r3||d<ng}t|ttf�sZ|g}nx1|D])}	td|	d|�}
|j|
�qaW|j||�S(ub
    Transfer files and directories to remote host.

    files
        A single path or a list of paths to be transferred.

    remote_path
        The path on the remote device where to store the files.

    recursive: ``True``
        Transfer files and directories recursively.

    preserve_times: ``False``
        Preserve ``mtime`` and ``atime`` of transferred files and directories.

    hostname
        The hostname of the remote device.

    port: ``22``
        The port of the remote device.

    username
        The username required for SSH authentication on the device.

    password
        Used for password authentication. It is also used for private key
        decryption if ``passphrase`` is not given.

    passphrase
        Used for decrypting private keys.

    pkey
        An optional private key to use for authentication.

    key_filename
        The filename, or list of filenames, of optional private key(s) and/or
        certificates to try for authentication.

    timeout
        An optional timeout (in seconds) for the TCP connect.

    socket_timeout: ``10``
        The channel socket timeout in seconds.

    buff_size: ``16384``
        The size of the SCP send buffer.

    allow_agent: ``True``
        Set to ``False`` to disable connecting to the SSH agent.

    look_for_keys: ``True``
        Set to ``False`` to disable searching for discoverable private key
        files in ``~/.ssh/``

    banner_timeout
        An optional timeout (in seconds) to wait for the SSH banner to be
        presented.

    auth_timeout
        An optional timeout (in seconds) to wait for an authentication
        response.

    auto_add_policy: ``False``
        Automatically add the host to the ``known_hosts``.

    CLI Example:

    .. code-block:: bash

        salt '*' scp.put /path/to/file /var/tmp/file hostname=server1 auto_add_policy=True
    u	recursiveupreserve_timesuremote_pathu
cp.cache_filetsaltenv(R"t
isinstancetlistttuplet__salt__Rtput(tfilesR$R&R'R)RR!t
put_kwargstcached_filestfile_tcached_file((s8/usr/lib/python2.7/site-packages/salt/modules/scp_mod.pyR.�sM


(t__doc__t
__future__RRRtloggingRtsalt.extRRR
tTrueRtImportErrorRt__proxyenabled__Rt	getLoggert__name__tlogRRR"R#RR.(((s8/usr/lib/python2.7/site-packages/salt/modules/scp_mod.pyt<module>	s.


				S

Zerion Mini Shell 1.0