def pscp()

in moneo.py [0:0]


def pscp(copy_path, destination_dir, hosts_file, timeout=300, max_threads=16, user=None):
    pscp_cmd = 'pscp.pssh'
    os_type = shell_cmd('awk -F= \'/^NAME/{print $2}\' /etc/os-release', 45)
    if 'Ubuntu' in os_type:
        pscp_cmd = 'parallel-scp'
    if user:
        pscp_cmd = pscp_cmd + " --user={}".format(user)
    pscp_cmd = pscp_cmd + \
        " -x '-o StrictHostKeyChecking=no' -r -t \
        0 -p {} -h {} {} {}".format(max_threads, hosts_file, copy_path, destination_dir)
    out = shell_cmd(pscp_cmd, timeout)
    if 'FAILURE' in out:
        raise Exception("Pscp command failed on one or more hosts with command {}, Output: {}".format(pscp_cmd, out))
    return out