Fix netconf plugin dispatch response

Fixes #53236

*  If dispatch() rpc response has data element
   return the xml string from `<data>` element
   else return the complete xml string from
   `<rpc-reply>`.

(cherry picked from commit aac5ef5e13)
pull/54918/head
Ganesh B Nalawade 6 years ago committed by Toshio Kuratomi
parent 78ebe74b61
commit b6f52a4b81

@ -0,0 +1,3 @@
---
bugfixes:
- Fix netconf plugin dispatch response (https://github.com/ansible/ansible/issues/53236)

@ -208,7 +208,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"):

Loading…
Cancel
Save