Skip to content

Commit

Permalink
Fix routeros net put (#595)
Browse files Browse the repository at this point in the history
* Update changelog to indicate fix

* Fix RouterOS net_put

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: jonathan lung <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sagar Paul <[email protected]>
  • Loading branch information
4 people authored Jun 10, 2024
1 parent 5cf24ae commit 78f628e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelogs/fragments/fix-routeros-net_put.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- Handle sftp error messages for file not present for routerOS.
2 changes: 1 addition & 1 deletion plugins/action/net_put.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def _handle_existing_file(self, conn, source, dest, proto, timeout):
)
except ConnectionError as exc:
error = to_text(exc)
if error.endswith("No such file or directory"):
if error.endswith("No such file or directory") or "File doesn't exist" in error:
if os.path.exists(tmp_source_file):
os.remove(tmp_source_file)
return True
Expand Down

0 comments on commit 78f628e

Please sign in to comment.