From 1eaffb6744ad34232ade9959395affd1da8e01f3 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Thu, 2 Aug 2018 10:36:18 +0100 Subject: [PATCH] commands/create: Only add instruments/output processors once Ensure that instruments and output processors are only added to the generated agenda once. --- wa/commands/create.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/wa/commands/create.py b/wa/commands/create.py index 80583e6f..f6c59fea 100644 --- a/wa/commands/create.py +++ b/wa/commands/create.py @@ -79,11 +79,12 @@ class CreateAgendaSubcommand(SubCommand): entry['params'] = config agenda['workloads'].append(entry) else: - if extcls.kind == 'instrument': - agenda['config']['augmentations'].append(name) - if extcls.kind == 'output_processor': - agenda['config']['augmentations'].append(name) - agenda['config'][name] = config + if extcls.kind in ('instrument', 'output_processor'): + if name not in agenda['config']['augmentations']: + agenda['config']['augmentations'].append(name) + + if name not in agenda['config']: + agenda['config'][name] = config if args.output: wfh = open(args.output, 'w')