Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
roverflow authored Jun 19, 2024
2 parents d01f09b + 4348f9f commit 9c5b2f1
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ repos:
- id: no-commit-to-branch
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
- repo: https://github.com/pycontribs/mirrors-prettier
rev: "v3.3.1"
hooks:
- id: prettier
additional_dependencies:
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ Ansible Netcommon Collection Release Notes

.. contents:: Topics


v7.0.0
======

Release Summary
---------------

Starting from this release, the minimum `ansible-core` version this collection requires is `2.15.0`. The last known version compatible with ansible-core<2.15 is v6.1.3.


Major Changes
-------------

- Bumping `requires_ansible` to `>=2.15.0`, since previous ansible-core versions are EoL now.

Bugfixes
--------

- Fix get api call during scp with libssh.
- Handle sftp error messages for file not present for routerOS.

Known Issues
------------

- libssh - net_put and net_get fail when the destination file intended to be fetched is not present.

v6.1.3
======

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This includes connection plugins, such as ``network_cli``, ``httpapi``, and ``ne
<!--start requires_ansible-->
## Ansible version compatibility

This collection has been tested against following Ansible versions: **>=2.14.0**.
This collection has been tested against following Ansible versions: **>=2.15.0**.

For collections that support Ansible 2.9, please ensure you update your `network_os` to use the
fully qualified collection name (for example, `cisco.ios.ios`).
Expand Down
20 changes: 20 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -774,3 +774,23 @@ releases:
fragments:
- bug_653.yaml
release_date: "2024-05-29"
7.0.0:
changes:
bugfixes:
- Fix get api call during scp with libssh.
- Handle sftp error messages for file not present for routerOS.
known_issues:
- libssh - net_put and net_get fail when the destination file intended to be
fetched is not present.
major_changes:
- Bumping `requires_ansible` to `>=2.15.0`, since previous ansible-core versions
are EoL now.
release_summary:
"Starting from this release, the minimum `ansible-core` version
this collection requires is `2.15.0`. The last known version compatible with
ansible-core<2.15 is v6.1.3."
fragments:
- fix-routeros-net_put.yaml
- libssh_get.yaml
- min_215.yaml
release_date: "2024-06-10"
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ readme: README.md
repository: https://github.com/ansible-collections/ansible.netcommon
issues: https://github.com/ansible-collections/ansible.netcommon/issues
tags: [networking, security, cloud, network_cli, netconf, httpapi, grpc]
version: 6.1.3
version: 7.0.0
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
requires_ansible: ">=2.14.0"
requires_ansible: ">=2.15.0"
plugin_routing:
action:
grpc_config:
Expand Down
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
5 changes: 4 additions & 1 deletion plugins/connection/libssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,10 @@ def fetch_file(self, in_path, out_path, proto="sftp"):
elif proto == "scp":
scp = self.ssh.scp()
try:
scp.get(out_path, in_path)
# this abruptly closes the connection when
# scp.get fails only when the file is not there
# it works fine if the file is actually present
scp.get(in_path, out_path)
except LibsshSCPException as exc:
raise AnsibleError("Error transferring file from %s: %s" % (out_path, to_text(exc)))
else:
Expand Down
9 changes: 1 addition & 8 deletions tox-ansible.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
[ansible]
skip =
py3.7
py3.8
2.9
2.10
2.11
2.12
2.13
skip = ""

0 comments on commit 9c5b2f1

Please sign in to comment.