mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
osdict: Add requires_internet() to OsMedia
In order to properly do a unattended installation of some medias (as net installers), we have to check whether the media requires or not internet. Doing so by checking its variant is not the most beautiful way (as variants do not have a set of predefined names), but that's the best that can be done with the current state of osinfo-db. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
parent
0247f97012
commit
313a95bd8e
@ -630,3 +630,11 @@ class _OsVariant(object):
|
||||
class OsMedia(object):
|
||||
def __init__(self, osinfo_media):
|
||||
self.osinfo_media = osinfo_media
|
||||
|
||||
def requires_internet(self):
|
||||
if self.osinfo_media:
|
||||
variants = list(_OsinfoIter(self.osinfo_media.get_os_variants()))
|
||||
for variant in variants:
|
||||
if "netinst" in variant.get_id():
|
||||
return True
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user