提交 6bdf51d3 编写于 作者: A Amador Pahim

avocado.core.loader change external-runner-chdir defaults to None

We do use default to None everywhere. external-runner-chdir seems to be the only
exception, being defaults to 'off'. This was harmless until we need to record
external-runner-chedir to further retrieve it in replay jobs.

This patch changes external-runner-chdir default from 'off' to None.
Signed-off-by: NAmador Pahim <apahim@redhat.com>
上级 36e80726
......@@ -378,8 +378,8 @@ def add_loader_options(parser):
'where those files are located, use "test" here and '
'specify the test directory with the option '
'"--external-runner-testdir". Defaults to "%(default)s"')
arggrp.add_argument('--external-runner-chdir', default='off',
choices=('runner', 'test', 'off'),
arggrp.add_argument('--external-runner-chdir', default=None,
choices=('runner', 'test'),
help=chdir_help)
arggrp.add_argument('--external-runner-testdir', metavar='DIRECTORY',
......@@ -725,7 +725,7 @@ class ExternalLoader(TestLoader):
@staticmethod
def _process_external_runner(args, runner):
""" Enables the external_runner when asked for """
chdir = getattr(args, 'external_runner_chdir', 'off')
chdir = getattr(args, 'external_runner_chdir', None)
test_dir = getattr(args, 'external_runner_testdir', None)
if runner:
......@@ -752,7 +752,7 @@ class ExternalLoader(TestLoader):
['runner', 'chdir',
'test_dir'])
return cls_external_runner(runner, chdir, test_dir)
elif chdir != "off":
elif chdir:
msg = ('Option "--external-runner-chdir" requires '
'"--external-runner" to be set.')
raise LoaderError(msg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册