79522279

Date: 2025-03-20 08:23:11
Score: 1.5
Natty:
Report link

Thank you for your replies!

I tried applying the fix from the pull request [#670](https://github.com/ansible-collections/ansible.netcommon/pull/670), but unfortunately, it does not resolve the issue for me.

Changes Applied from the PR

I updated `netconf_config.py` with the proposed modifications:

```diff
- from ansible.module_utils._text import to_text
+ from ansible.module_utils._text import to_native, to_text

- confirm = module.params["confirm"]
+ confirm = to_text(module.params["confirm"], error="surrogate_or_strict")

However, I noticed that there is a typo in the to_text() call. The parameter should be errors, not error.

Even after fixing this, I get the following error:

'>' not supported between instances of 'str' and 'int'

Other Attempts

I also tried modifying the argument_spec to change the confirm parameter type:

Attempt 1: Changing type to "text"

confirm=dict(type="text", default="0")

Error:

argument 'confirm' is of type <class 'int'> and we were unable to convert to text: 'NoneType' object is not callable

Attempt 2: Changing type to "str"

confirm=dict(type="str", default="0")

Error:

'>' not supported between instances of 'str' and 'int'

At this point, I haven't found a working solution.

I have some Python knowledge, but I’m not an expert in Ansible module development, so I’m not sure where to go from here.
If anyone has insights on how to properly handle this, I would greatly appreciate the help! 🚀

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • RegEx Blacklisted phrase (1): I get the following error
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Julien Claerhout