From 50c69c48621aa8aa48d9cff7259a2ae8d540cded Mon Sep 17 00:00:00 2001 From: rohitthakur2590 Date: Thu, 3 Oct 2024 08:39:51 +0530 Subject: [PATCH 1/2] Bugfix: Fix commit timeout type failure issue Signed-off-by: rohitthakur2590 --- changelogs/fragments/confirm_commit_error_fix.yaml | 4 ++++ plugins/modules/netconf_config.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/confirm_commit_error_fix.yaml diff --git a/changelogs/fragments/confirm_commit_error_fix.yaml b/changelogs/fragments/confirm_commit_error_fix.yaml new file mode 100644 index 000000000..a3a9496a4 --- /dev/null +++ b/changelogs/fragments/confirm_commit_error_fix.yaml @@ -0,0 +1,4 @@ +--- +bugfixes: + - Confirmed commit results in Failure becuase of wrongly provided type + (https://github.com/ansible-collections/ansible.netcommon/issues/551) diff --git a/plugins/modules/netconf_config.py b/plugins/modules/netconf_config.py index 87c1c9c01..9db7e6db6 100644 --- a/plugins/modules/netconf_config.py +++ b/plugins/modules/netconf_config.py @@ -406,6 +406,7 @@ from ansible.module_utils._text import to_text from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.connection import Connection, ConnectionError +from ansible.module_utils._text import to_native, to_text from ansible_collections.ansible.netcommon.plugins.module_utils.network.netconf.netconf import ( get_capabilities, @@ -488,7 +489,7 @@ def main(): source = module.params["source_datastore"] delete = module.params["delete"] confirm_commit = module.params["confirm_commit"] - confirm = module.params["confirm"] + confirm = to_text(module.params["confirm"], error="surrogate_or_strict") validate = module.params["validate"] save = module.params["save"] filter = module.params["get_filter"] From 101d3360480e8229b916ad33a9b537bdfd8005ab Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 03:14:23 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- plugins/modules/netconf_config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/modules/netconf_config.py b/plugins/modules/netconf_config.py index 9db7e6db6..05396d3a8 100644 --- a/plugins/modules/netconf_config.py +++ b/plugins/modules/netconf_config.py @@ -403,10 +403,9 @@ """ -from ansible.module_utils._text import to_text +from ansible.module_utils._text import to_native, to_text from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.connection import Connection, ConnectionError -from ansible.module_utils._text import to_native, to_text from ansible_collections.ansible.netcommon.plugins.module_utils.network.netconf.netconf import ( get_capabilities,