1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00: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') energy_config = pluginloader.get_default_config('energy_measurement')
agenda['config']['augmentations'].append('energy_measurement') agenda['config']['augmentations'].append('energy_measurement')
agenda['config']['energy_measurement'] = energy_config 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 agenda['config']['energy_measurement']['instrument_parameters'] = config
elif extcls.kind == 'workload': elif extcls.kind == 'workload':
entry = OrderedDict() entry = OrderedDict()
@ -236,11 +236,11 @@ class CreateAgendaSubcommand(SubCommand):
agenda['workloads'].append(entry) agenda['workloads'].append(entry)
else: else:
if extcls.kind in ('instrument', 'output_processor'): if extcls.kind in ('instrument', 'output_processor'):
if name not in agenda['config']['augmentations']: if extcls.name not in agenda['config']['augmentations']:
agenda['config']['augmentations'].append(name) agenda['config']['augmentations'].append(extcls.name)
if name not in agenda['config']: if extcls.name not in agenda['config']:
agenda['config'][name] = config agenda['config'][extcls.name] = config
if args.output: if args.output:
wfh = open(args.output, 'w') wfh = open(args.output, 'w')