diff --git a/tes/sshwrapper/__init__.py b/tes/sshwrapper/__init__.py index 0a6c6e62e4589d8073ece219f0fb217e6efc383f..e6ed2389fb77a4b2dc9b997d9f1d5482e851a5dc 100644 --- a/tes/sshwrapper/__init__.py +++ b/tes/sshwrapper/__init__.py @@ -185,7 +185,7 @@ class Ssh: return @staticmethod - def sftpls(sess, host, user, sshport, path="",changepath="."): + def sftpls(sess, host, user, sshport, path=".",changepath="."): """ Use sftp to run an ls on the given path. Return the directory listing (as a list) and the cwd @@ -200,6 +200,10 @@ class Ssh: Ssh.validate_username(user) Ssh.validate_hostname(host) ctrlsocket = Ssh.get_ctrl_master_socket(sess, host, user, sshport) + if (path is None or path == ""): + path="." + if (changepath is None or changepath == ""): + changepath="." exec_p = subprocess.Popen(['sftp', '-b', '-','-o', 'Stricthostkeychecking=no', '-P', sshport, '-o', 'ControlPath={}'.format(ctrlsocket), '{}@{}'.format(user, host)],