diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-31 08:01:28 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-31 08:01:28 +0100 |
commit | e12df2ca5c71ad672ebbfefbc47cabbac3333d61 (patch) | |
tree | c49481d8ee73281d59f83d02ac2ef46c35d0033d /meta/lib/oe | |
parent | f0065d7a6973628803a17c57f2265512aba3234c (diff) | |
download | openembedded-core-e12df2ca5c71ad672ebbfefbc47cabbac3333d61.tar.gz openembedded-core-e12df2ca5c71ad672ebbfefbc47cabbac3333d61.tar.bz2 openembedded-core-e12df2ca5c71ad672ebbfefbc47cabbac3333d61.zip |
lib/oe/lsb.py: Map unknown distributions to 'Unknown'
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/lsb.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py index 36dd12fc80..c8852a2b65 100644 --- a/meta/lib/oe/lsb.py +++ b/meta/lib/oe/lsb.py @@ -5,7 +5,7 @@ def release_dict(): try: output, err = bb.process.run(['lsb_release', '-a'], stderr=PIPE) except bb.process.CmdError as exc: - return + return None data = {} for line in output.splitlines(): @@ -22,7 +22,13 @@ def distro_identifier(adjust_hook=None): with optional adjustment via a hook""" lsb_data = release_dict() - distro_id, release = lsb_data['Distributor ID'], lsb_data['Release'] + if lsb_data: + distro_id, release = lsb_data['Distributor ID'], lsb_data['Release'] + else: + distro_id, release = None, None + if adjust_hook: distro_id, release = adjust_hook(distro_id, release) + if not distro_id: + return "Unknown" return '{0}-{1}'.format(distro_id, release).replace(' ','-') |