MCPcopy Create free account
hub / github.com/baidu/tera / SSH

Class SSH

example/docker/cluster_setup.py:12–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10import tera
11
12class SSH():
13 def __init__(self):
14 self.s = paramiko.SSHClient()
15 self.s.load_system_host_keys()
16 self.s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
17
18 def run_cmd(self, ip, cmd):
19 try:
20 self.s.connect(ip)
21 stdin, stdout, stderr = self.s.exec_command(cmd)
22 self.s.close()
23 except:
24 traceback.print_exc()
25 return stdin, stdout, stderr
26
27def parse_input():
28 parser = argparse.ArgumentParser()

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected