diff options
-rwxr-xr-x | tests/docker/docker.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/docker/docker.py b/tests/docker/docker.py index b85c165130..71b0d27e18 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -37,9 +37,12 @@ def _guess_docker_command(): """ Guess a working docker command or raise exception if not found""" commands = [["docker"], ["sudo", "-n", "docker"]] for cmd in commands: - if subprocess.call(cmd + ["images"], - stdout=DEVNULL, stderr=DEVNULL) == 0: - return cmd + try: + if subprocess.call(cmd + ["images"], + stdout=DEVNULL, stderr=DEVNULL) == 0: + return cmd + except OSError: + pass commands_txt = "\n".join([" " + " ".join(x) for x in commands]) raise Exception("Cannot find working docker command. Tried:\n%s" % \ commands_txt) |