17 lines
618 B
Python
17 lines
618 B
Python
import paramiko
|
|
|
|
|
|
async def cleanup_iperf_server(node, ip, username, password, log):
|
|
await log("++ stopping iperf server on {}".format(node))
|
|
|
|
myconn = paramiko.SSHClient()
|
|
myconn.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
|
|
myconn.connect(ip, username=username, password=password)
|
|
|
|
remote_cmd = 'pgrep iperf | xargs kill'
|
|
(stdin, stdout, stderr) = myconn.exec_command(remote_cmd)
|
|
await log("{}".format(stdout.read()))
|
|
await log("{}".format(type(myconn)))
|
|
await log("Options available to deal with the connections are many like\n{}".format(dir(myconn)))
|
|
myconn.close() |