def connect_to_instance_in_ssh(address, keypair_path, user='root'):
"""
Run the command LS on a given instance
:param address: ip or dns name of a machine
:type address: str
:param keypair_path: keypair path
:type keypair_path: str
"""
env.host_string = address
env.user = user
env.parallel = False
env.key_filename = keypair_path
env.disable_known_hosts = True
env.connection_attempts = 10
env.timeout = 120
ocb.log(run('ls -la /root'), level='INFO')
connect_to_instance_in_vpc.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录