*  ncclient API expects commit timeout value in either unicode
   or bytes format, hence convert the timeout value explicitly
   to string type.
pull/71105/head
Ganesh Nalawade 4 years ago committed by GitHub
parent 02f4fc1a14
commit ca118613aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- Confirmed commit fails with TypeError in IOS XR netconf plugin (https://github.com/ansible-collections/cisco.iosxr/issues/74)

@ -24,7 +24,7 @@ from functools import wraps
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
from ansible.plugins import AnsiblePlugin from ansible.plugins import AnsiblePlugin
from ansible.module_utils._text import to_native from ansible.module_utils._text import to_native, to_text
from ansible.module_utils.basic import missing_required_lib from ansible.module_utils.basic import missing_required_lib
try: try:
@ -269,6 +269,7 @@ class NetconfBase(AnsiblePlugin):
and set a token on the ongoing confirmed commit and set a token on the ongoing confirmed commit
:return: Returns xml string containing the RPC response received from remote host :return: Returns xml string containing the RPC response received from remote host
""" """
timeout = to_text(timeout, errors='surrogate_or_strict')
resp = self.m.commit(confirmed=confirmed, timeout=timeout, persist=persist) resp = self.m.commit(confirmed=confirmed, timeout=timeout, persist=persist)
return resp.data_xml if hasattr(resp, 'data_xml') else resp.xml return resp.data_xml if hasattr(resp, 'data_xml') else resp.xml

Loading…
Cancel
Save