Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hgi 4481 #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions target_sftp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ def upload(args):
# check if structure exists before changing
sftp_client.chdir(dir) #will change if folder already exists
except IOError:
logger.info(f"Creating new folder path at {sftp_client.getcwd()}")
try:
sftp_client.mkdir(dir)
logger.info(f"Creating output path at {sftp_client.getcwd()}")
sftp_client.chdir(dir)
except Exception as e:
logger.info(f"Failed to create folder path at {sftp_client.getcwd()}. Folder skipped {dir}. Error message {e}")
raise NotADirectoryError(e)


for root, dirs, files in os.walk(config["input_path"]):
Expand Down