Skip to content

Commit 056f361

Browse files
RoseReatherfordmauromsl
authored andcommitted
Adds an option to not confirm file sent afterwards.
1 parent 56a863e commit 056f361

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

janeway_ftp/sftp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def send_file_via_sftp(
2424
file_path,
2525
file_name,
2626
known_hosts_file=None,
27+
confirm_file_sent=True,
2728
):
2829

2930
ssh = paramiko.SSHClient()
@@ -51,7 +52,7 @@ def send_file_via_sftp(
5152
ensure_remote_directory(sftp, remote_file_path)
5253

5354
upload_path = f"{remote_file_path}/{file_name}"
54-
sftp.put(file_path, upload_path)
55+
sftp.put(file_path, upload_path, confirm=confirm_file_sent)
5556
logging.info(f"File uploaded successfully to {upload_path}")
5657
except Exception as e:
5758
logging.error(f"Failed to send file via SFTP: {e}")

0 commit comments

Comments
 (0)