From 7e1eba3f4b93cf2d7539ac83522885dc6f65d638 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Tue, 29 Oct 2024 14:47:17 +0000 Subject: [PATCH 1/2] iperf readability --- moler/cmd/unix/iperf.py | 2 +- moler/cmd/unix/iperf2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/moler/cmd/unix/iperf.py b/moler/cmd/unix/iperf.py index bac04fd47..833c2a05e 100644 --- a/moler/cmd/unix/iperf.py +++ b/moler/cmd/unix/iperf.py @@ -90,7 +90,7 @@ def _command_failure(self, line): if self._regex_helper.search_compiled(Iperf._re_command_failure, line): self.set_exception( CommandFailure( - self, f"ERROR: {self._regex_helper.group('FAILURE_MSG')}" + self, f"ERROR: found in command output: \"{self._regex_helper.group('FAILURE_MSG')}\"" ) ) raise ParsingDone diff --git a/moler/cmd/unix/iperf2.py b/moler/cmd/unix/iperf2.py index df4b89895..eb425a511 100644 --- a/moler/cmd/unix/iperf2.py +++ b/moler/cmd/unix/iperf2.py @@ -277,7 +277,7 @@ def _command_failure(self, line): if self._regex_helper.search_compiled(Iperf2._re_command_failure, line): self.set_exception( CommandFailure( - self, f"ERROR: {self._regex_helper.group('FAILURE_MSG')}" + self, f"ERROR: found in command output: \"{self._regex_helper.group('FAILURE_MSG')}\"" ) ) raise ParsingDone From b6eb2e4a65be3c6d0b8683bb6191af27c2e2b855 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Tue, 29 Oct 2024 14:53:38 +0000 Subject: [PATCH 2/2] CommandTextualGeneric --- moler/cmd/commandtextualgeneric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moler/cmd/commandtextualgeneric.py b/moler/cmd/commandtextualgeneric.py index 8502473b3..13491df18 100644 --- a/moler/cmd/commandtextualgeneric.py +++ b/moler/cmd/commandtextualgeneric.py @@ -115,7 +115,7 @@ def __init__( ) self.debug_data_received = False # Set True to log as hex all data received by command in data_received self.re_fail = ( - None # Regex to failure the command if it occurrs in the command output + None # Regex to failure the command if it occurs in the command output ) if not self._newline_chars: @@ -645,7 +645,7 @@ def failure_indiction(self, line: str, is_full_line: bool) -> None: if self.is_failure_indication(line=line, is_full_line=is_full_line): if self._is_failure_exception(line=line, is_full_line=is_full_line) is False: self.set_exception( - CommandFailure(self, f"command failed in line '{line}'") + CommandFailure(self, f"command failed in the command output line '{line}'.") ) def _is_failure_exception(self, line: str, is_full_line: bool) -> bool: