Skip to content

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

@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