存储和使用自定义 ssh 路径来运行 Fabric 的正确方法是什么
这似乎不起作用:
fabric.yaml:
set_runtime_ssh_path: 'my/ssh/path'
main.py:
with open('fabric.yaml') as config_file:
config = yaml.safe_load(config_file)
with Connection('example.com',
connect_kwargs={'set_runtime_ssh_path': config.get('set_runtime_ssh_path'), 'password': 'password'}) as conn:
conn.run('whoami', pty=True)
config = Config(runtime_ssh_path = "路径/到/ssh")
请记住,您无法更改可执行烧瓶的用途,这只是加载任何配置文件(如.ssh/config)