From 67b2b8caf1a91166a23de9450aa0345e2ed924b0 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Thu, 27 Aug 2020 23:22:49 +0530 Subject: [PATCH] Fix netconf validate capability check (#71195) (#71252) * Use ``:validate`` string to check if the netconf server supports validate capability as per netconf RFC (cherry picked from commit 7635d23cee873fc98f69782c2665746da64ca416) --- changelogs/fragments/71195-netconf_config_validate_issue.yaml | 2 ++ lib/ansible/plugins/netconf/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/71195-netconf_config_validate_issue.yaml diff --git a/changelogs/fragments/71195-netconf_config_validate_issue.yaml b/changelogs/fragments/71195-netconf_config_validate_issue.yaml new file mode 100644 index 00000000000..c4f1d2e585d --- /dev/null +++ b/changelogs/fragments/71195-netconf_config_validate_issue.yaml @@ -0,0 +1,2 @@ +bugfixes: +- Fixed Ansible reporting validate not supported by netconf server when enabled in netconf - (https://github.com/ansible-collections/ansible.netcommon/issues/119). diff --git a/lib/ansible/plugins/netconf/__init__.py b/lib/ansible/plugins/netconf/__init__.py index 529cc260675..d25f4d3598b 100644 --- a/lib/ansible/plugins/netconf/__init__.py +++ b/lib/ansible/plugins/netconf/__init__.py @@ -354,7 +354,7 @@ class NetconfBase(AnsiblePlugin): operations['supports_startup'] = ':startup' in capabilities operations['supports_xpath'] = ':xpath' in capabilities operations['supports_writable_running'] = ':writable-running' in capabilities - operations['supports_validate'] = ':writable-validate' in capabilities + operations['supports_validate'] = ':validate' in capabilities operations['lock_datastore'] = [] if operations['supports_writable_running']: