summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/metadata.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/utils/metadata.py')
-rw-r--r--meta/lib/oeqa/utils/metadata.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/meta/lib/oeqa/utils/metadata.py b/meta/lib/oeqa/utils/metadata.py
index 2316841e0f..df6ed91052 100644
--- a/meta/lib/oeqa/utils/metadata.py
+++ b/meta/lib/oeqa/utils/metadata.py
@@ -10,9 +10,7 @@ from collections.abc import MutableMapping
10from xml.dom.minidom import parseString 10from xml.dom.minidom import parseString
11from xml.etree.ElementTree import Element, tostring 11from xml.etree.ElementTree import Element, tostring
12 12
13from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars 13from oeqa.utils.commands import runCmd, get_bb_vars
14
15metadata_vars = ['MACHINE', 'DISTRO', 'DISTRO_VERSION']
16 14
17def get_os_release(): 15def get_os_release():
18 """Get info from /etc/os-release as a dict""" 16 """Get info from /etc/os-release as a dict"""
@@ -35,9 +33,14 @@ def metadata_from_bb():
35 info_dict = OrderedDict() 33 info_dict = OrderedDict()
36 hostname = runCmd('hostname') 34 hostname = runCmd('hostname')
37 info_dict['hostname'] = hostname.output 35 info_dict['hostname'] = hostname.output
38 data_dict = get_bb_vars(metadata_vars) 36 data_dict = get_bb_vars()
39 for var in metadata_vars: 37
40 info_dict[var.lower()] = data_dict[var] 38 info_dict['machine'] = data_dict['MACHINE']
39
40 # Distro information
41 info_dict['distro'] = {'id': data_dict['DISTRO'],
42 'version_id': data_dict['DISTRO_VERSION'],
43 'pretty_name': '%s %s' % (data_dict['DISTRO'], data_dict['DISTRO_VERSION'])}
41 44
42 # Host distro information 45 # Host distro information
43 os_release = get_os_release() 46 os_release = get_os_release()
@@ -47,7 +50,7 @@ def metadata_from_bb():
47 if key in os_release: 50 if key in os_release:
48 info_dict['host_distro'][key] = os_release[key] 51 info_dict['host_distro'][key] = os_release[key]
49 52
50 info_dict['layers'] = get_layers(get_bb_var('BBLAYERS')) 53 info_dict['layers'] = get_layers(data_dict['BBLAYERS'])
51 return info_dict 54 return info_dict
52 55
53def metadata_from_data_store(d): 56def metadata_from_data_store(d):