8000 Bugfix: Fix commit timeout type failure issue by rohitthakur2590 · Pull Request #670 · ansible-collections/ansible.netcommon · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bugfix: Fix commit timeout type failure issue #670

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rohitthakur2590
Copy link
Contributor
SUMMARY

resolve: #551

ISSUE TYPE
  • Bugfix Pull Request
  • Docs Pull Request
  • Feature Pull Request
  • New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
@Dalle55
Copy link
Dalle55 commented May 6, 2025

Hi
We've been testing it in a dedicated virtualenv on Cisco IOS XE devices, and would like to report a few important issues that surfaced — along with a working patch and reproduction steps.

1. to_text() called with unsupported keyword error

This line is problematic:

confirm = to_text(module.params["confirm"], error="surrogate_or_strict")
  • to_text() from ansible.module_utils._text does not support the error keyword.
  • It causes immediate runtime failure:
TypeError: to_text() got an unexpected keyword argument 'error'

Fix used in our local patch:

confirm = to_text(module.params["confirm"])

2. Confirm value not properly cast

If confirm is passed as an integer from the playbook (as in confirm: 10), Ansible will fail with:

Argument must be bytes or unicode, got 'int'

Fix applied:

We explicitly convert confirm to string before using it in any NETCONF RPC or XML operation:

confirm = str(to_text(module.params["confirm"]))

Temporary workaround:

We split the commit logic into two steps using netconf_rpc manually after pushing config via netconf_config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

netconf_config false argument when using confirm_commit
3 participants
0