Skip to content

Commit

Permalink
Fix netconf plugin dispatch response (ansible#54326)
Browse files Browse the repository at this point in the history
Fixes ansible#53236

*  If dispatch() rpc response has data element
   return the xml string from `<data>` element
   else return the complete xml string from
   `<rpc-reply>`.
  • Loading branch information
ganeshrn authored Mar 26, 2019
1 parent 8aec69d commit ac07c6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/plugins/netconf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def dispatch(self, rpc_command=None, source=None, filter=None):
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"):
Expand Down

0 comments on commit ac07c6b

Please sign in to comment.