Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix commit timeout failure issue for netconf modules #71292

Merged
merged 1 commit into from Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/iosxr_netconf_config_commit_fix.yaml
@@ -0,0 +1,2 @@
bugfixes:
- Confirmed commit fails with TypeError in IOS XR netconf plugin (https://github.com/ansible-collections/cisco.iosxr/issues/74)
3 changes: 2 additions & 1 deletion lib/ansible/plugins/netconf/__init__.py
Expand Up @@ -24,7 +24,7 @@

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:
Expand Down Expand Up @@ -269,6 +269,7 @@ def commit(self, confirmed=False, timeout=None, persist=None):
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

Expand Down