From 3ef39e9b9e258ec65f8af0276320da9c6cad7195 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 24 Feb 2017 20:49:27 +0100 Subject: [PATCH] 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 --- osmopy/osmoutil.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 @@ import importlib """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)