From 75277b82b56b53297836a900c979591a4ec98b22 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Fri, 13 Sep 2019 18:45:41 +0100 Subject: [PATCH] Help with troubleshooting failures from venv.py This patch changes the call() method from the venv.py module to redirect the messages from stderr to stdout. At the moment when commands ran by call() fails we lose the stderr which can give very important hints about what went wrong. With the redirection its possible to see the messages from stderr in the tox output, for example: ========================= Failures during discovery ========================= --- stdout --- ovn-nbctl: unix:/var/run/ovn/ovnnb_db.sock: database connection failed (No such file or directory) --- import errors --- Failed to import test module: networking_ovn.tests.functional.test_impl_idl Traceback (most recent call last): File " Change-Id: I38c3953b02c61f38da0bf7151cac37a12fd8706c Signed-off-by: Lucas Alvares Gomes --- ovsdbapp/venv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ovsdbapp/venv.py b/ovsdbapp/venv.py index c59a67a3..5791579a 100644 --- a/ovsdbapp/venv.py +++ b/ovsdbapp/venv.py @@ -113,7 +113,8 @@ class OvsVenvFixture(fixtures.Fixture): def call(self, cmd, *args, **kwargs): cwd = kwargs.pop('cwd', self.venv) return subprocess.check_call( - cmd, *args, env=self.env, cwd=cwd, **kwargs) + cmd, *args, env=self.env, stderr=subprocess.STDOUT, + cwd=cwd, **kwargs) def get_pids(self): files = glob.glob(os.path.join(self.venv, "*.pid"))