From a52d5f99cfecf572e0497a02644b34e0c9cf922e Mon Sep 17 00:00:00 2001 From: Lucas Meneghel Rodrigues Date: Thu, 28 Aug 2014 14:19:30 -0300 Subject: [PATCH] avocado.plugins.multiplexer: Fix -c option Make the multiplexer plugin to properly produce the environment relative to each variant. Before, we had an exception when calling option -c. Signed-off-by: Lucas Meneghel Rodrigues --- avocado/plugins/multiplexer.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/avocado/plugins/multiplexer.py b/avocado/plugins/multiplexer.py index 9545bb73..a2487add 100644 --- a/avocado/plugins/multiplexer.py +++ b/avocado/plugins/multiplexer.py @@ -68,15 +68,19 @@ class Multiplexer(plugin.Plugin): data = tree.read_ordered_yaml(open(multiplex_file)) t = tree.create_from_ordered_data(data) pipe.write(t.get_ascii()) - sys.exit(0) + sys.exit(error_codes.numeric_status['AVOCADO_ALL_OK']) variants = multiplexer.create_variants_from_yaml(open(multiplex_file)) pipe.write(bcolors.header_str('Variants generated:')) pipe.write('\n') - for (index, dct) in enumerate(variants): - pipe.write(' Variant %s: %s\n' % (index+1, [str(x) for x in dct])) + for (index, tpl) in enumerate(variants): + pipe.write('Variant %s: %s\n' % (index+1, [str(x) for x in tpl])) if args.contents: - for key in sorted(dct.keys()): - pipe.write(' %s = %s\n' % (key, dct.get(key))) + env = {} + for node in tpl: + env.update(node.environment) + for k in sorted(env.keys()): + pipe.write(' %s: %s\n' % (k, env[k])) + sys.exit(error_codes.numeric_status['AVOCADO_ALL_OK']) -- GitLab