*  ncclient API expects commit timeout value in either unicode
   or bytes format, hence convert the timeout value explicitly
   to string type.
This commit is contained in:
Ganesh Nalawade 2020-08-27 23:17:40 +05:30 committed by GitHub
parent 02f4fc1a14
commit ca118613aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

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

View file

@ -24,7 +24,7 @@ from functools import wraps
from ansible.errors import AnsibleError
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
try:
@ -269,6 +269,7 @@ class NetconfBase(AnsiblePlugin):
and set a token on the ongoing confirmed commit
: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)
return resp.data_xml if hasattr(resp, 'data_xml') else resp.xml