Fix netconf plugin dispatch response (#54326)

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>`.
This commit is contained in:
Ganesh Nalawade 2019-03-26 10:23:26 +05:30 committed by GitHub
parent 8aec69dd89
commit ac07c6b5e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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