Skip to content
Snippets Groups Projects
Commit 4070833c authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

refactor list in ssh_client.py

parent ebc16a36
No related branches found
No related tags found
No related merge requests found
...@@ -158,11 +158,7 @@ class SSHClient(object): ...@@ -158,11 +158,7 @@ class SSHClient(object):
cwd = os.path.join(cwd, os.path.split(filepattern)[0]).replace("\\", "/") cwd = os.path.join(cwd, os.path.split(filepattern)[0]).replace("\\", "/")
filepattern = os.path.split(filepattern)[1] filepattern = os.path.split(filepattern)[1]
_, out, _ = self.execute(r'find %s -maxdepth 1 -type f -name "%s"' % (cwd, filepattern)) _, out, _ = self.execute(r'find %s -maxdepth 1 -type f -name "%s"' % (cwd, filepattern))
files = [] return [file for file in out.strip().split("\n") if file != ""]
for file in out.strip().split("\n"):
if file != "":
files.append(file.strip())
return files
class SharedSSHClient(SSHClient): class SharedSSHClient(SSHClient):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment