[PATCH] python/osmo-python-tests[master]: osmoutil: centrally log process launches

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Feb 24 19:47:46 UTC 2017


osmoutil: centrally log process launches

Log Popen in osmoutil.py instead of in each python test. Launch message is
being removed in openbsc's python tests and added here. (change-id
Id8eb70ddfdc1d0d9f90aa5343a4ea522042c34ee)

Change-Id: I7e539abc3aeee91ae3e7635f9e28b9e557eaf969
---
M osmopy/osmoutil.py
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/07/1907/2

diff --git a/osmopy/osmoutil.py b/osmopy/osmoutil.py
index 78465d9..bb03614 100755
--- a/osmopy/osmoutil.py
+++ b/osmopy/osmoutil.py
@@ -23,8 +23,10 @@
 """Run a command, with stdout and stderr directed to devnull"""
 
 
-def popen_devnull(cmd):
+def popen_devnull(cmd, verbose=True):
     devnull = open(os.devnull, 'w')
+    if verbose:
+        print "Launching: PWD=%s %s" % (os.getcwd(), ' '.join([repr(c) for c in cmd]))
     return subprocess.Popen(cmd, stdout=devnull, stderr=devnull)
 
 

-- 
To view, visit https://gerrit.osmocom.org/1907
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7e539abc3aeee91ae3e7635f9e28b9e557eaf969
Gerrit-PatchSet: 2
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>


More information about the gerrit-log mailing list