Change in osmo-gsm-tester[master]: process: provide API to return filename for process output

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/.

srs_andre gerrit-no-reply at lists.osmocom.org
Wed Jul 1 09:49:39 UTC 2020


srs_andre has submitted this change. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18985 )

Change subject: process: provide API to return filename for process output
......................................................................

process: provide API to return filename for process output

this is useful if the caller handles the opening/reading from
the file itself

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

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/core/process.py b/src/osmo_gsm_tester/core/process.py
index 1823a20..eaf8de7 100644
--- a/src/osmo_gsm_tester/core/process.py
+++ b/src/osmo_gsm_tester/core/process.py
@@ -321,12 +321,20 @@
         return self.process_obj is not None and self.result is None
 
     def get_output(self, which):
+        ''' Read process output '''
+        path = self.get_output_file(which)
+        if path is None:
+            return None
+        with open(path, 'r') as f2:
+            return f2.read()
+
+    def get_output_file(self, which):
+        ''' Return filename for given output '''
         v = self.outputs.get(which)
         if not v:
             return None
         path, f = v
-        with open(path, 'r') as f2:
-            return f2.read()
+        return path
 
     def get_output_tail(self, which, tail=10, prefix=''):
         out = self.get_output(which)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18985
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: I5e70fd1593a5bc7902fa218aae6452103545e4e0
Gerrit-Change-Number: 18985
Gerrit-PatchSet: 2
Gerrit-Owner: srs_andre <andre at softwareradiosystems.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: srs_andre <andre at softwareradiosystems.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200701/0e410663/attachment.htm>


More information about the gerrit-log mailing list