# Path: lab/ssh.py
# SSH_OPTS = ['-o', 'UserKnownHostsFile=/dev/null',
#             '-o', 'StrictHostKeyChecking=no',
#             '-o', 'ServerAliveInterval=5']
# def walk(self, remotepath):
# def get_paramiko_sftp(hostname, **kwargs):
# def get_paramiko_ssh(hostname, **kwargs):
# def get_generic_sftp(hostname, **kwargs):
#     def get_transport(**kwargs):
#     def get_sftp(transport):
#     def iter_credentials():
# def get_generic_ssh(hostname, **kwargs):


from builtins import object
from lab.ssh import get_ssh, get_sftp
import logging
#
# Copyright 2017 Sangoma Technologies Inc.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Communication drivers and connection management.
"""


log = logging.getLogger(name='lab.comms')


_registry = {
    'ssh': {
        'factory': lambda location: get_ssh(location),
        'is_up': lambda ssh: ssh._session.alive(),
        'magic_methods': ['__getitem__']
    },
    'sftp': {

# Path: lab/ssh.py
# SSH_OPTS = ['-o', 'UserKnownHostsFile=/dev/null',
#             '-o', 'StrictHostKeyChecking=no',
#             '-o', 'ServerAliveInterval=5']
# def walk(self, remotepath):
# def get_paramiko_sftp(hostname, **kwargs):
# def get_paramiko_ssh(hostname, **kwargs):
# def get_generic_sftp(hostname, **kwargs):
#     def get_transport(**kwargs):
#     def get_sftp(transport):
#     def iter_credentials():
# def get_generic_ssh(hostname, **kwargs):


# Path: lab/comms.py
from builtins import object
from lab.ssh import get_ssh, get_sftp
import logging

#
# Copyright 2017 Sangoma Technologies Inc.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Communication drivers and connection management.
"""


log = logging.getLogger(name='lab.comms')


_registry = {
    'ssh': {
        'factory': lambda location: get_ssh(location),
        'is_up': lambda ssh: ssh._session.alive(),
        'magic_methods': ['__getitem__']
    },
    'sftp': {

        'factory': lambda location: get_sftp(location),