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>`.
pull/54382/head
Ganesh Nalawade 6 years ago committed by GitHub
parent 8aec69dd89
commit ac07c6b5e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save