osdict: handle libosinfo lookup failure

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2014-03-26 13:49:32 +01:00
parent 6b5171031e
commit a3e1444a28

View File

@ -167,7 +167,7 @@ def get_recommended_resources(variant, arch):
def lookup_os_by_media(location):
media = libosinfo.Media.create_from_location(location, None)
ret = loader.get_db().guess_os_from_media(media)
if len(ret) > 0:
if ret and len(ret) > 0:
return ret[0].get_short_id()
return None