diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2017-01-13 15:12:45 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-19 22:45:46 +0000 |
commit | 6e7e6e37664b0a86111272f5f6f4a4e1d0f23302 (patch) | |
tree | 91ab3f0c523e2204654411d959684f14848473d5 /meta/lib/oeqa/utils | |
parent | 71ca7dab08fc500b231054249aacc90ae4aa85da (diff) | |
download | openembedded-core-contrib-6e7e6e37664b0a86111272f5f6f4a4e1d0f23302.tar.gz |
oeqa.utils.metadata: allow storing any bitbake config variables
Make it possible to store any bitbake config variables in the metadata.
Config values will be stored under a new config element in the xml report:
<config>
<variable name="MACHINE">qemux86</variable>
</config>
The value of MACHINE is moved there instead of having a dedicated
<machine> element.
[YOCTO #10590]
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r-- | meta/lib/oeqa/utils/metadata.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/lib/oeqa/utils/metadata.py b/meta/lib/oeqa/utils/metadata.py index a3c1b2b46c..08d8198935 100644 --- a/meta/lib/oeqa/utils/metadata.py +++ b/meta/lib/oeqa/utils/metadata.py @@ -29,14 +29,13 @@ def metadata_from_bb(): Data will be gathered using bitbake -e thanks to get_bb_vars. """ + metadata_config_vars = ('MACHINE') info_dict = OrderedDict() hostname = runCmd('hostname') info_dict['hostname'] = hostname.output data_dict = get_bb_vars() - info_dict['machine'] = data_dict['MACHINE'] - # Distro information info_dict['distro'] = {'id': data_dict['DISTRO'], 'version_id': data_dict['DISTRO_VERSION'], @@ -52,6 +51,10 @@ def metadata_from_bb(): info_dict['layers'] = get_layers(data_dict['BBLAYERS']) info_dict['bitbake'] = git_rev_info(os.path.dirname(bb.__file__)) + + info_dict['config'] = OrderedDict() + for var in sorted(metadata_config_vars): + info_dict['config'][var] = data_dict[var] return info_dict def metadata_from_data_store(d): @@ -106,7 +109,10 @@ def dict_to_XML(tag, dictionary, **kwargs): elif isinstance(val, MutableMapping): child = (dict_to_XML(key, val)) else: - child = Element(key) + if tag == 'config': + child = Element('variable', name=key) + else: + child = Element(key) child.text = str(val) elem.append(child) return elem |