summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oe/lsb.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py
index 5a795a12d3..3a945e0fce 100644
--- a/meta/lib/oe/lsb.py
+++ b/meta/lib/oe/lsb.py
@@ -15,9 +15,6 @@ def release_dict_osr():
15 if key == 'VERSION_ID': 15 if key == 'VERSION_ID':
16 data['DISTRIB_RELEASE'] = val.strip('"') 16 data['DISTRIB_RELEASE'] = val.strip('"')
17 17
18 if len(data.keys()) != 2:
19 return None
20
21 return data 18 return data
22 19
23def release_dict_lsb(): 20def release_dict_lsb():
@@ -27,7 +24,7 @@ def release_dict_lsb():
27 try: 24 try:
28 output, err = bb.process.run(['lsb_release', '-ir'], stderr=PIPE) 25 output, err = bb.process.run(['lsb_release', '-ir'], stderr=PIPE)
29 except bb.process.CmdError as exc: 26 except bb.process.CmdError as exc:
30 return None 27 return {}
31 28
32 lsb_map = { 'Distributor ID': 'DISTRIB_ID', 29 lsb_map = { 'Distributor ID': 'DISTRIB_ID',
33 'Release': 'DISTRIB_RELEASE'} 30 'Release': 'DISTRIB_RELEASE'}
@@ -51,7 +48,7 @@ def release_dict_lsb():
51 48
52def release_dict_file(): 49def release_dict_file():
53 """ Try to gather release information manually when other methods fail """ 50 """ Try to gather release information manually when other methods fail """
54 data = None 51 data = {}
55 try: 52 try:
56 if os.path.exists('/etc/lsb-release'): 53 if os.path.exists('/etc/lsb-release'):
57 data = {} 54 data = {}
@@ -78,7 +75,7 @@ def release_dict_file():
78 break 75 break
79 76
80 except IOError: 77 except IOError:
81 return None 78 return {}
82 return data 79 return data
83 80
84def distro_identifier(adjust_hook=None): 81def distro_identifier(adjust_hook=None):
@@ -96,8 +93,8 @@ def distro_identifier(adjust_hook=None):
96 if not distro_data: 93 if not distro_data:
97 distro_data = release_dict_file() 94 distro_data = release_dict_file()
98 95
99 distro_id = distro_data['DISTRIB_ID'] 96 distro_id = distro_data.get('DISTRIB_ID', '')
100 release = distro_data['DISTRIB_RELEASE'] 97 release = distro_data.get('DISTRIB_RELEASE', '')
101 98
102 if adjust_hook: 99 if adjust_hook:
103 distro_id, release = adjust_hook(distro_id, release) 100 distro_id, release = adjust_hook(distro_id, release)