How to use the scp.SCPClient.__init__ function in scp

To help you get started, we’ve selected a few scp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github saltstack / salt / salt / modules / scp_mod.py View on Github external
def _select_kwargs(**kwargs):
    paramiko_kwargs = {}
    scp_kwargs = {}
    PARAMIKO_KWARGS, _, _, _ = inspect.getargspec(paramiko.SSHClient.connect)
    PARAMIKO_KWARGS.pop(0)  # strip self
    PARAMIKO_KWARGS.append('auto_add_policy')
    SCP_KWARGS, _, _, _ = inspect.getargspec(scp.SCPClient.__init__)
    SCP_KWARGS.pop(0)  # strip self
    SCP_KWARGS.pop(0)  # strip transport arg (it is passed in _prepare_connection)
    for karg, warg in six.iteritems(kwargs):
        if karg in PARAMIKO_KWARGS and warg is not None:
            paramiko_kwargs[karg] = warg
        if karg in SCP_KWARGS and warg is not None:
            scp_kwargs[karg] = warg
    return paramiko_kwargs, scp_kwargs

scp

scp module for paramiko

LGPL-2.1
Latest version published 1 year ago

Package Health Score

74 / 100
Full package analysis