From ac07c6b5e6bef82642d0ebb9c8574e011f298ec7 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Tue, 26 Mar 2019 10:23:26 +0530 Subject: [PATCH] Fix netconf plugin dispatch response (#54326) Fixes #53236 * If dispatch() rpc response has data element return the xml string from `` element else return the complete xml string from ``. --- lib/ansible/plugins/netconf/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/netconf/__init__.py b/lib/ansible/plugins/netconf/__init__.py index 2a8b20c5ff6..4920b4fbbb0 100644 --- a/lib/ansible/plugins/netconf/__init__.py +++ b/lib/ansible/plugins/netconf/__init__.py @@ -211,7 +211,7 @@ class NetconfBase(AnsiblePlugin): raise ValueError('rpc_command value must be provided') req = fromstring(rpc_command) resp = self.m.dispatch(req, source=source, filter=filter) - return resp.data_xml if hasattr(resp, 'data_xml') else resp.xml + return resp.data_xml if resp.data_ele else resp.xml @ensure_connected def lock(self, target="candidate"):