From 587b645ec9a3e39b107e9a6d47cd571ab148cfad Mon Sep 17 00:00:00 2001 From: Andrew Grigorev Date: Tue, 26 Mar 2019 19:30:28 +0300 Subject: [PATCH] ssh: walk_files error description --- dvc/remote/ssh/connection.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dvc/remote/ssh/connection.py b/dvc/remote/ssh/connection.py index 6071dd2ec..f8576a7f1 100644 --- a/dvc/remote/ssh/connection.py +++ b/dvc/remote/ssh/connection.py @@ -128,7 +128,17 @@ class SSHConnection: self._sftp_connect() - for entry in self._sftp.listdir_attr(directory): + try: + dir_entries = self._sftp.listdir_attr(directory) + except IOError as exc: + raise DvcException( + "couldn't get the '{}' remote directory files list".format( + directory + ), + cause=exc, + ) + + for entry in dir_entries: path = posixpath.join(directory, entry.filename) if S_ISLNK(entry.st_mode):