mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-05 09:17:57 +03:00
osdict: handle libosinfo lookup failure
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
6b5171031e
commit
a3e1444a28
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user