I used paramiko to execute "virsh list --all" command remotely, but can't get the whole output, my code is
import paramiko
def paramiko_connect(hostname, command):
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=hostname)
std_in, std_out, std_err = ssh.exec_command(command)
output = std_out.read().decode("utf-8")
return output
cmd = "virsh list --all"
result = paramiko_connect("10.10.10.10", cmd)
print(result)
the code's output is
Id Name State
----------------------------------------------------
but the real output in remote server is
Id Name State
----------------------------------------------------
1 VM_Test running
How can I get the remote server's real output?