Change in osmo-gsm-tester[master]: process output: do not leak ANSI colors past logged stdout/stderr

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Sun Dec 6 22:24:46 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21565 )


Change subject: process output: do not leak ANSI colors past logged stdout/stderr
......................................................................

process output: do not leak ANSI colors past logged stdout/stderr

In jenkins, I still saw incidents of the entire log becoming colored
after a colored stderr snippet was printed to the log. Make absolutely
sure that no unterminated ANSI coloring is leaked.

Change-Id: Ib9ac1eea4a12d6d43ac8614491f016bbe9ca17b1
---
M src/osmo_gsm_tester/core/process.py
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/65/21565/1

diff --git a/src/osmo_gsm_tester/core/process.py b/src/osmo_gsm_tester/core/process.py
index eeccef8..51e2781 100644
--- a/src/osmo_gsm_tester/core/process.py
+++ b/src/osmo_gsm_tester/core/process.py
@@ -338,7 +338,7 @@
         with open(path, 'r') as f2:
             if since_mark > 0:
                 f2.seek(since_mark)
-            return f2.read()
+            return self.end_ansi_colors(f2.read())
 
     def get_output_file(self, which):
         ''' Return filename for given output '''
@@ -354,7 +354,7 @@
             return None
         out = out.splitlines()
         tail = min(len(out), tail)
-        return prefix + ('\n' + prefix).join(out[-tail:])
+        return prefix + self.end_ansi_colors(('\n' + prefix).join(out[-tail:]))
 
     def get_output_mark(self, which):
         out = self.get_output(which)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21565
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ib9ac1eea4a12d6d43ac8614491f016bbe9ca17b1
Gerrit-Change-Number: 21565
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201206/ff9790ed/attachment.htm>


More information about the gerrit-log mailing list