ssh.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:AerisCloud 作者: AerisCloud 项目源码 文件源码
def _services(ip, timeout, *extra_args):
    args = ['ssh', ip, '-t']

    if extra_args:
        args += list(extra_args)

    args += ['-o', 'StrictHostKeyChecking no',
             '-o', 'ConnectTimeout %d' % timeout,
             '-o', 'BatchMode yes',
             '--',
             'cat', '/etc/aeriscloud.d/*']

    try:
        return [
            dict(zip(
                ['name', 'port', 'path'],
                service.strip().split(',')
            ))
            for service in check_output(args).split('\n')
            if service
        ]
    except CalledProcessError:
        return []
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号