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

TargetDescription: generate default config

Added a method to TargetDescrition to generate a dict with the default
config for that description.
This commit is contained in:
Sergei Trofimov 2017-04-24 10:43:21 +01:00
parent 386dede4a8
commit f1eeff726f

View File

@ -82,6 +82,14 @@ class TargetDescription(object):
self._set('platform_params', platform_params)
self._set('conn_params', conn_params)
def get_default_config(self):
param_attrs = ['target_params', 'platform_params', 'conn_params']
config = {}
for pattr in param_attrs:
for n, p in getattr(self, pattr).itervalues():
config[n] = p.default
return config
def _set(self, attr, vals):
if vals is None:
vals = {}