Skip to content

Commit

Permalink
Merge pull request #1243 from MetPX/issue1242
Browse files Browse the repository at this point in the history
fix #1242 sftp making subdirs when it shouldn't
  • Loading branch information
petersilva authored Sep 27, 2024
2 parents 0a13250 + 2ef7ae7 commit 1ebc35a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sarracenia/transfer/sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def cd(self, path):

# cd forced
def cd_forced(self, path):
""" try to cd to a directory. If the cd fails, create the directory
"""
logger.debug("sr_sftp cd_forced %o %s" % (self.o.permDirDefault, path))

# try to go directly to path
Expand All @@ -102,6 +104,8 @@ def cd_forced(self, path):
self.sftp.chdir(self.originalDir)
self.sftp.chdir(path)
alarm_cancel()
# cd was successful, no need to create the dir, just return
return
except:
pass
finally:
Expand Down

0 comments on commit 1ebc35a

Please sign in to comment.