From dc378b545daa23ef7d5f2a92239f2161849fce6d Mon Sep 17 00:00:00 2001 From: "Mads M. Pedersen" <mmpe@dtu.dk> Date: Tue, 18 Dec 2018 09:33:46 +0100 Subject: [PATCH] Improved main example of SSHClient --- wetb/utils/cluster_tools/ssh_client.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/wetb/utils/cluster_tools/ssh_client.py b/wetb/utils/cluster_tools/ssh_client.py index b729ee85..cc7419f9 100644 --- a/wetb/utils/cluster_tools/ssh_client.py +++ b/wetb/utils/cluster_tools/ssh_client.py @@ -417,11 +417,10 @@ class SharedSSHClient(SSHClient): if __name__ == "__main__": - from mmpe.ui.qt_ui import QtInputUI - q = QtInputUI(None) - x = None - username, password = "mmpe", x.password # q.get_login("mmpe") - - client = SSHClient(host='gorm', port=22, username=username, password=password) - print(client.glob("*.*", ".hawc2launcher/medium1__1__")) - # ssh.upload('../News.txt', 'news.txt') + try: + import x + username, password = 'mmpe', x.password + client = SSHClient(host='jess.dtu.dk', port=22, username=username, password=password) + print(client.execute("echo hello $USER from $HOSTNAME")[1]) + except ImportError: + x = None -- GitLab