From 30908b8536d982bb374242bab541b381f976841f Mon Sep 17 00:00:00 2001 From: Rohit Thakur Date: Fri, 5 Jul 2024 17:26:51 +0530 Subject: [PATCH 1/4] Update content_templates_parser.py --- plugins/sub_plugins/cli_parser/content_templates_parser.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/sub_plugins/cli_parser/content_templates_parser.py b/plugins/sub_plugins/cli_parser/content_templates_parser.py index 6d837b9df..aa43b04cb 100644 --- a/plugins/sub_plugins/cli_parser/content_templates_parser.py +++ b/plugins/sub_plugins/cli_parser/content_templates_parser.py @@ -23,7 +23,7 @@ """ EXAMPLES = """ -- name: "Run command and parse with native" +- name: "Run command and parse with content_templates" ansible.utils.cli_parse: command: "show bgp summary" parser: @@ -41,7 +41,7 @@ class CliParser(CliParserBase): - """The native parser class + """The content_templates parser class Convert raw text to structured data using the resource module parser """ @@ -72,8 +72,7 @@ def parse(self, *_args, **kwargs): try: parser.PARSERS = template_obj out = {"parsed": parser.parse()} - print(out) return out except Exception as exc: - msg = "Native parser returned an error while parsing. Error: {err}" + msg = "An error occurred during content_templates parsing. Error: {err}" return {"errors": [msg.format(err=to_native(exc))]} From 2e4adab87f048b5f6917fa822dd39d5ab022190c Mon Sep 17 00:00:00 2001 From: Rohit Thakur Date: Fri, 5 Jul 2024 17:30:41 +0530 Subject: [PATCH 2/4] Create update_error_msg.yaml --- changelogs/fragments/update_error_msg.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/update_error_msg.yaml diff --git a/changelogs/fragments/update_error_msg.yaml b/changelogs/fragments/update_error_msg.yaml new file mode 100644 index 000000000..cf3f2e1d9 --- /dev/null +++ b/changelogs/fragments/update_error_msg.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - "Updated the error message for the content_templates parser to include the correct parser name and detailed error information." From 5e0fa1333ac9747a43256d29608bb7eda2a5acf5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 12:02:12 +0000 Subject: [PATCH 3/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- changelogs/fragments/update_error_msg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/update_error_msg.yaml b/changelogs/fragments/update_error_msg.yaml index cf3f2e1d9..8f87acd0e 100644 --- a/changelogs/fragments/update_error_msg.yaml +++ b/changelogs/fragments/update_error_msg.yaml @@ -1,3 +1,3 @@ --- trivial: - - "Updated the error message for the content_templates parser to include the correct parser name and detailed error information." + - "Updated the error message for the content_templates parser to include the correct parser name and detailed error information." From 7e35103d0e6d413fb059d71a2bf09db8b34bced5 Mon Sep 17 00:00:00 2001 From: Rohit Thakur Date: Fri, 5 Jul 2024 17:34:00 +0530 Subject: [PATCH 4/4] Update update_error_msg.yaml --- changelogs/fragments/update_error_msg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/update_error_msg.yaml b/changelogs/fragments/update_error_msg.yaml index 8f87acd0e..d25bc5f2a 100644 --- a/changelogs/fragments/update_error_msg.yaml +++ b/changelogs/fragments/update_error_msg.yaml @@ -1,3 +1,3 @@ --- trivial: - - "Updated the error message for the content_templates parser to include the correct parser name and detailed error information." + - Updated the error message for the content_templates parser to include the correct parser name and detailed error information.