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
Tue Jun 23 14:41:17 UTC 2020


srs_andre has uploaded this change for review. ( 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, 8 insertions(+), 2 deletions(-)



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

diff --git a/src/osmo_gsm_tester/core/process.py b/src/osmo_gsm_tester/core/process.py
index 1823a20..19eafd1 100644
--- a/src/osmo_gsm_tester/core/process.py
+++ b/src/osmo_gsm_tester/core/process.py
@@ -321,12 +321,18 @@
         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)
+        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: 1
Gerrit-Owner: srs_andre <andre at softwareradiosystems.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200623/7c797cff/attachment.htm>


More information about the gerrit-log mailing list