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

Fix routeros net put #595

Merged
merged 6 commits into from
Jun 10, 2024
Merged

Conversation

lungj
Copy link
Contributor

@lungj lungj commented Oct 25, 2023

SUMMARY

Fixes #583 by searching for the sftp error message for non-existent files when interacting with RouterOS.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

net_put.py

ADDITIONAL INFORMATION

The existing code searches for an error message, "No such file or directory". Using sftp with RouterOS instead results in "File doesn't exist".

Instead of searching the end of the string, be a bit more lenient on where the string is located when scanning. Since this code is only invoked on error, unless someone has a file with that string as part of a filename, we're not going to spuriously execute the if-block on success. Even so, all we end up doing is removing a temporary file.

There was no need to change net_get.

@lungj lungj temporarily deployed to ack October 25, 2023 18:45 — with GitHub Actions Inactive
@pre-commit-ci pre-commit-ci bot temporarily deployed to ack October 25, 2023 18:47 Inactive
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/990fe60be4844ee8a88200dc34fd74c0

ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 FAILURE in 24m 37s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 FAILURE in 1h 16m 33s
✔️ ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 SUCCESS in 1h 08m 40s
ansible-test-network-integration-junos-vsrx-netconf-python39 RETRY_LIMIT in 6m 15s
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 NODE_FAILURE Node request 200-0006546782 failed in 0s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 SUCCESS in 16m 10s
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 SUCCESS in 18m 57s
ansible-test-network-integration-junos-vsrx-network_cli-python39 NODE_FAILURE Node request 200-0006546785 failed in 0s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 FAILURE in 15m 15s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 NODE_FAILURE Node request 200-0006546787 failed in 0s
✔️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 SUCCESS in 21m 45s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 RETRY_LIMIT in 6m 48s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 31m 04s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 31m 09s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 38m 13s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 29m 45s (non-voting)
ansible-test-network-integration-eos-network_cli-python39 RETRY_LIMIT in 5m 49s (non-voting)
ansible-test-network-integration-eos-httpapi-python39 RETRY_LIMIT in 9m 52s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39 RETRY_LIMIT in 6m 13s (non-voting)
ansible-ee-integration-ios-latest RETRY_LIMIT in 4m 03s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 13m 53s (non-voting)
ansible-ee-integration-ios-stable-2.11 RETRY_LIMIT in 3m 17s (non-voting)
ansible-ee-integration-ios-stable-2.12 RETRY_LIMIT in 3m 10s (non-voting)
ansible-ee-integration-ios-libssh-latest NODE_FAILURE Node request 200-0006546801 failed in 0s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 13m 25s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 NODE_FAILURE Node request 200-0006546830 failed in 0s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 3m 47s (non-voting)
ansible-test-network-integration-vyos-paramiko-python39-devel NODE_FAILURE Node request 200-0006546805 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable214 NODE_FAILURE Node request 200-0006546806 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable213 NODE_FAILURE Node request 200-0006546807 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable212 NODE_FAILURE Node request 200-0006546808 failed in 0s
ansible-test-network-integration-vyos-paramiko-python36-stable29 NODE_FAILURE Node request 200-0006546809 failed in 0s (non-voting)
ansible-test-network-integration-vyos-libssh-python39-devel NODE_FAILURE Node request 200-0006546810 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable214 NODE_FAILURE Node request 200-0006546811 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable213 NODE_FAILURE Node request 200-0006546812 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable212 NODE_FAILURE Node request 200-0006546813 failed in 0s
ansible-test-network-integration-vyos-libssh-python36-stable29 NODE_FAILURE Node request 200-0006546814 failed in 0s
✔️ build-ansible-collection SUCCESS in 17m 39s
ansible-test-network-integration-ansible-netcommon-junos-vsrx-netconf-python39 NODE_FAILURE Node request 200-0006546815 failed in 0s
✔️ ansible-tox-linters SUCCESS in 13m 13s
✔️ ansible-galaxy-importer SUCCESS in 4m 21s

@github-actions github-actions bot added the bug This issue/PR relates to a bug. label Dec 8, 2023
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/60b1faa63ed44f31a13cb63e10a5ba4d

ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 FAILURE in 13m 10s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 SUCCESS in 1h 17m 18s
✔️ ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 SUCCESS in 1h 06m 09s
ansible-test-network-integration-junos-vsrx-netconf-python39 RETRY_LIMIT in 11m 36s
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 FAILURE in 12m 52s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 SUCCESS in 16m 17s
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 SUCCESS in 15m 24s
ansible-test-network-integration-junos-vsrx-network_cli-python39 RETRY_LIMIT in 5m 54s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 FAILURE in 13m 19s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 SUCCESS in 16m 07s
✔️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 SUCCESS in 14m 30s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 RETRY_LIMIT in 9m 07s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 30m 08s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 30m 56s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario03 SUCCESS in 37m 55s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 28m 11s (non-voting)
ansible-test-network-integration-eos-network_cli-python39 RETRY_LIMIT in 1m 18s (non-voting)
ansible-test-network-integration-eos-httpapi-python39 RETRY_LIMIT in 1m 13s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39 RETRY_LIMIT in 1m 05s (non-voting)
ansible-ee-integration-ios-latest RETRY_LIMIT in 4m 11s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 13m 55s (non-voting)
ansible-ee-integration-ios-stable-2.11 RETRY_LIMIT in 3m 53s (non-voting)
ansible-ee-integration-ios-stable-2.12 RETRY_LIMIT in 3m 19s (non-voting)
ansible-ee-integration-ios-libssh-latest RETRY_LIMIT in 3m 18s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 13m 42s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 RETRY_LIMIT in 3m 27s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 3m 09s (non-voting)
ansible-test-network-integration-vyos-paramiko-python39-devel NODE_FAILURE Node request 200-0006732591 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable214 NODE_FAILURE Node request 200-0006732592 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable213 NODE_FAILURE Node request 200-0006732593 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable212 NODE_FAILURE Node request 200-0006732594 failed in 0s
ansible-test-network-integration-vyos-paramiko-python36-stable29 NODE_FAILURE Node request 200-0006732595 failed in 0s (non-voting)
ansible-test-network-integration-vyos-libssh-python39-devel NODE_FAILURE Node request 200-0006732596 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable214 NODE_FAILURE Node request 200-0006732597 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable213 NODE_FAILURE Node request 200-0006732598 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable212 NODE_FAILURE Node request 200-0006732599 failed in 0s
ansible-test-network-integration-vyos-libssh-python36-stable29 NODE_FAILURE Node request 200-0006732600 failed in 0s
✔️ build-ansible-collection SUCCESS in 16m 29s
ansible-test-network-integration-ansible-netcommon-junos-vsrx-netconf-python39 RETRY_LIMIT in 5m 59s
✔️ ansible-tox-linters SUCCESS in 11m 44s
✔️ ansible-galaxy-importer SUCCESS in 5m 06s

Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/f7168f17ea9a46c6ac2f227f3638c5b0

ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 RETRY_LIMIT in 7m 38s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 SUCCESS in 1h 20m 46s
✔️ ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 SUCCESS in 1h 09m 06s
ansible-test-network-integration-junos-vsrx-netconf-python39 RETRY_LIMIT in 4m 32s
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 FAILURE in 13m 46s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 SUCCESS in 20m 10s
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 SUCCESS in 15m 32s
ansible-test-network-integration-junos-vsrx-network_cli-python39 RETRY_LIMIT in 14m 49s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 FAILURE in 29m 36s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 SUCCESS in 17m 06s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 FAILURE in 18m 48s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 RETRY_LIMIT in 6m 18s
ansible-test-network-integration-vyos-paramiko-python39-devel NODE_FAILURE Node request 200-0007225804 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable214 NODE_FAILURE Node request 200-0007225805 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable213 NODE_FAILURE Node request 200-0007225806 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable212 NODE_FAILURE Node request 200-0007225807 failed in 0s
ansible-test-network-integration-vyos-paramiko-python36-stable29 NODE_FAILURE Node request 200-0007225808 failed in 0s (non-voting)
ansible-test-network-integration-vyos-libssh-python39-devel NODE_FAILURE Node request 200-0007225809 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable214 NODE_FAILURE Node request 200-0007225810 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable213 NODE_FAILURE Node request 200-0007225811 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable212 NODE_FAILURE Node request 200-0007225812 failed in 0s
ansible-test-network-integration-vyos-libssh-python36-stable29 NODE_FAILURE Node request 200-0007225813 failed in 0s
✔️ build-ansible-collection SUCCESS in 14m 21s
ansible-test-network-integration-ansible-netcommon-junos-vsrx-netconf-python39 RETRY_LIMIT in 9m 51s
ansible-tox-linters FAILURE in 12m 01s
✔️ ansible-galaxy-importer SUCCESS in 4m 59s

@KB-perByte KB-perByte merged commit 78f628e into ansible-collections:main Jun 10, 2024
52 of 54 checks passed
@lungj lungj deleted the fix-routeros-net_put branch August 26, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

net_put for uploading files on routerOS
3 participants