提交 9d6bb585 编写于 作者: L Lukáš Doktor

avocado: Replace "multiplex_files" with "multiplex"

The option changed from --multiplex-files to `--multiplex` long time ago
but we kept using the original `multiplex_files` destination for it.
This is not systematic and can lead to problems in the future. Let's
change it once for all.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 905a45ef
......@@ -425,7 +425,7 @@ class Mux(object):
:param debug: Whether to debug the mux parsing
"""
# Merge the multiplex_files
multiplex_files = getattr(args, "multiplex_files", None)
multiplex_files = getattr(args, "multiplex", None)
if multiplex_files:
self.data_merge(yaml2tree(multiplex_files, debug=debug))
......
......@@ -80,7 +80,7 @@ class RemoteTestRunner(TestRunner):
test_data = path + '.data'
if os.path.isdir(test_data):
self.remote.send_files(test_data, os.path.dirname(rpath))
for mux_file in getattr(self.job.args, 'multiplex_files') or []:
for mux_file in getattr(self.job.args, 'multiplex') or []:
rpath = os.path.join(self.remote_test_dir, mux_file)
self.remote.makedir(os.path.dirname(rpath))
self.remote.send_files(mux_file, rpath)
......@@ -181,7 +181,7 @@ class RemoteTestRunner(TestRunner):
extra_params = []
mux_files = [os.path.join(self.remote_test_dir, mux_file)
for mux_file in getattr(self.job.args,
'multiplex_files') or []]
'multiplex') or []]
if mux_files:
extra_params.append("--multiplex %s" % " ".join(mux_files))
......
......@@ -39,7 +39,7 @@ class Multiplex(CLICmd):
return
parser = super(Multiplex, self).configure(parser)
parser.add_argument('multiplex_files', nargs='+',
parser.add_argument('multiplex', nargs='+',
help='Path(s) to a multiplex file(s)')
parser.add_argument('--filter-only', nargs='*', default=[],
......
......@@ -125,7 +125,7 @@ class Replay(CLI):
log = logging.getLogger("avocado.app")
err = None
if args.replay_teststatus and args.multiplex_files:
if args.replay_teststatus and args.multiplex:
err = ("Option --replay-test-status is incompatible with "
"--multiplex.")
elif args.replay_teststatus and args.url:
......@@ -205,12 +205,12 @@ class Replay(CLI):
log.warn("Ignoring multiplex from source job with "
"--replay-ignore.")
else:
if getattr(args, 'multiplex_files', None) is not None:
if getattr(args, 'multiplex', None) is not None:
log.warn('Overriding the replay multiplex with '
'--multiplex-file.')
# Use absolute paths to avoid problems with os.chdir
args.multiplex_files = [os.path.abspath(_)
for _ in args.multiplex_files]
args.multiplex = [os.path.abspath(_)
for _ in args.multiplex]
else:
mux = jobdata.retrieve_mux(resultsdir)
if mux is None:
......
......@@ -135,7 +135,6 @@ class Run(CLICmd):
mux = parser.add_argument_group('test parameters')
if multiplexer.MULTIPLEX_CAPABLE:
mux.add_argument('-m', '--multiplex', nargs='*',
dest='multiplex_files',
default=None, metavar='FILE',
help='Location of one or more Avocado multiplex '
'(.yaml) FILE(s) (order dependent)')
......
......@@ -38,7 +38,7 @@ class RemoteTestRunnerTest(unittest.TestCase):
remote_no_copy=False,
remote_timeout=60,
show_job_log=False,
multiplex_files=['foo.yaml', 'bar/baz.yaml'],
multiplex=['foo.yaml', 'bar/baz.yaml'],
dry_run=True,
env_keep=None)
log = flexmock()
......@@ -113,7 +113,7 @@ _=/usr/bin/env''', exit_status=0)
Results = flexmock(remote=Remote, urls=['sleeptest'],
stream=stream, timeout=None,
args=flexmock(show_job_log=False,
multiplex_files=['foo.yaml', 'bar/baz.yaml'],
multiplex=['foo.yaml', 'bar/baz.yaml'],
dry_run=True))
Results.should_receive('start_tests').once().ordered()
args = {'status': u'PASS', 'whiteboard': '', 'time_start': 0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册