From 309a37de862dd73acdd0d85102299031ee40537d Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 1 Feb 2017 11:15:08 -0800 Subject: [PATCH] Add `--debug` option to `ansible-test`. --- test/runner/lib/ansible_util.py | 3 +++ test/runner/lib/util.py | 1 + test/runner/test.py | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/test/runner/lib/ansible_util.py b/test/runner/lib/ansible_util.py index 732c4cb76b..f0f558d1d2 100644 --- a/test/runner/lib/ansible_util.py +++ b/test/runner/lib/ansible_util.py @@ -32,4 +32,7 @@ def ansible_environment(args): env.update(ansible) + if args.debug: + env.update(dict(ANSIBLE_DEBUG='true')) + return env diff --git a/test/runner/lib/util.py b/test/runner/lib/util.py index 51d2bfe934..0326c27089 100644 --- a/test/runner/lib/util.py +++ b/test/runner/lib/util.py @@ -416,6 +416,7 @@ class CommonConfig(object): self.color = args.color # type: bool self.explain = args.explain # type: bool self.verbosity = args.verbosity # type: int + self.debug = args.debug # type: bool class EnvironmentConfig(CommonConfig): diff --git a/test/runner/test.py b/test/runner/test.py index c604258ed4..e08b6ccdcc 100755 --- a/test/runner/test.py +++ b/test/runner/test.py @@ -132,6 +132,10 @@ def parse_args(): const='yes', default='auto') + common.add_argument('--debug', + action='store_true', + help='run ansible commands in debug mode') + test = argparse.ArgumentParser(add_help=False, parents=[common]) test.add_argument('include',