From 422df61ad87d76474f58e6b5dc7b0798efd9decc Mon Sep 17 00:00:00 2001 From: Andrey Vertiprahov Date: Wed, 20 Apr 2022 21:57:19 +0500 Subject: [PATCH] Cleanup bugger on cli parse_object_stream when cli error. --- core/script/cli/cli.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/script/cli/cli.py b/core/script/cli/cli.py index 54120d6505..f25cad4823 100644 --- a/core/script/cli/cli.py +++ b/core/script/cli/cli.py @@ -262,16 +262,18 @@ class CLI(BaseCLI): self.profile.send_on_syntax_error, self.command, error_text ) self.error = self.script.CLISyntaxError(error_text) - break + buffer = b"" + await self.send(cmd_stop) # Then check for operation error if ( self.profile.rx_pattern_operation_error_str and self.profile.rx_pattern_operation_error.search(buffer) ): self.error = self.script.CLIOperationError(buffer) - break + buffer = b"" + await self.send(cmd_stop) # Parse all possible objects - while buffer: + while buffer and not self.error: pr = parser(smart_text(buffer, errors="replace")) if not pr: break # No new objects -- GitLab