Skip to content

Commit

Permalink
sshutils: fix bug in ls() and glob1()
Browse files Browse the repository at this point in the history
Updated these functions to use posixpath everywhere internally given
that they operate on remote (posix) paths. This was originally the plan
but clearly my mind drifted off while implementing...:/

closes gh-147
  • Loading branch information
jtriley committed Oct 24, 2012
1 parent cee76ff commit 64fa4b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions starcluster/sshutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def ls(self, path):
"""
Return a list containing the names of the entries in the remote path.
"""
return [os.path.join(path, f) for f in self.sftp.listdir(path)]
return [posixpath.join(path, f) for f in self.sftp.listdir(path)]

def glob(self, pattern):
return self._glob.glob(pattern)
Expand Down Expand Up @@ -738,7 +738,7 @@ def glob1(self, dirname, pattern):
#dirname = unicode(dirname, encoding)
dirname = unicode(dirname, 'UTF-8')
try:
names = [os.path.basename(n) for n in self.paramiko.ls(dirname)]
names = [posixpath.basename(n) for n in self.paramiko.ls(dirname)]
except os.error:
return []
if pattern[0] != '.':
Expand Down

0 comments on commit 64fa4b8

Please sign in to comment.