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

avocado: Store result multiplex file directly in args

When using replay, one can think of the replay_multiplex as of the
normal multiplex files, only it's already processed. This patch
stores the retrieved multiplex file (if not overridden) directly in
multiplex_files and adds support in avocado.core.job to handle this
situation.

Actually some future plugins might benefit from this and create their
own inherited Mux class instead of our multiplexer.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 b87b9691
......@@ -437,8 +437,9 @@ class Job(object):
"for details" % (" ".join(urls) if urls else "\b"))
raise exceptions.OptionValidationError(e_msg)
if getattr(self.args, 'replay_mux', None) is not None:
mux = self.args.replay_mux
if isinstance(getattr(self.args, 'multiplex_files', None),
multiplexer.Mux):
mux = self.args.multiplex_files # pylint: disable=E1101
else:
try:
mux = multiplexer.Mux(self.args)
......
......@@ -153,6 +153,9 @@ class Replay(CLI):
msg = 'Overriding the replay multiplex with '\
'--multiplex-file.'
view.notify(event='warning', msg=(msg))
# Use absolute paths to avoid problems with os.chdir
args.multiplex_files = [os.path.abspath(_)
for _ in args.multiplex_files]
else:
mux = replay.retrieve_mux(resultsdir)
if mux is None:
......@@ -160,7 +163,7 @@ class Replay(CLI):
view.notify(event='error', msg=(msg))
sys.exit(exit_codes.AVOCADO_JOB_FAIL)
else:
setattr(args, 'replay_mux', mux)
setattr(args, "multiplex_files", mux)
if args.replay_teststatus:
replay_map = replay.retrieve_replay_map(resultsdir,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册