From ab5dd24430f4bb8ef8a430135e39d3e558f5d07f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 11 Jul 2017 16:00:08 -0700 Subject: [PATCH] Handle pip/python errors in ansible-test better. --- test/runner/lib/executor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/runner/lib/executor.py b/test/runner/lib/executor.py index 0e4f2490ed..d8abfdda57 100644 --- a/test/runner/lib/executor.py +++ b/test/runner/lib/executor.py @@ -1262,7 +1262,11 @@ class EnvironmentDescription(object): :type command: list[str] :rtype: str """ - stdout, stderr = raw_command(command, capture=True, cmd_verbosity=2) + try: + stdout, stderr = raw_command(command, capture=True, cmd_verbosity=2) + except SubprocessError: + return None # all failures are equal, we don't care why it failed, only that it did + return (stdout or '').strip() + (stderr or '').strip() @staticmethod