* 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:
parent
02f4fc1a14
commit
ca118613aa
2 changed files with 4 additions and 1 deletions
|
@ -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.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
|
||||
|
||||
|
|
Loading…
Reference in a new issue