1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

commands/create: Use class name rather than user supplied name

Use the actual name of the plugin instead of the user supplied value,
for consistency and ensure that duplicate entries cannot be specified.
This commit is contained in:
Marc Bonnici 2018-09-20 11:59:51 +01:00
parent a7d0b6fdbd
commit a1213cf84e

View File

@ -225,7 +225,7 @@ class CreateAgendaSubcommand(SubCommand):
energy_config = pluginloader.get_default_config('energy_measurement')
agenda['config']['augmentations'].append('energy_measurement')
agenda['config']['energy_measurement'] = energy_config
agenda['config']['energy_measurement']['instrument'] = name
agenda['config']['energy_measurement']['instrument'] = extcls.name
agenda['config']['energy_measurement']['instrument_parameters'] = config
elif extcls.kind == 'workload':
entry = OrderedDict()
@ -236,11 +236,11 @@ class CreateAgendaSubcommand(SubCommand):
agenda['workloads'].append(entry)
else:
if extcls.kind in ('instrument', 'output_processor'):
if name not in agenda['config']['augmentations']:
agenda['config']['augmentations'].append(name)
if extcls.name not in agenda['config']['augmentations']:
agenda['config']['augmentations'].append(extcls.name)
if name not in agenda['config']:
agenda['config'][name] = config
if extcls.name not in agenda['config']:
agenda['config'][extcls.name] = config
if args.output:
wfh = open(args.output, 'w')