[virt-tools-list] [virt-install PATCH v2 6/7] installertreemedia: Add requires_internet()

Fabiano Fidêncio fidencio at redhat.com
Fri Mar 22 15:23:40 UTC 2019


This method returns whether the installer requires or not internet to
perform the installation.

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 virtinst/installertreemedia.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/virtinst/installertreemedia.py b/virtinst/installertreemedia.py
index 7e97c10a..52ec40ed 100644
--- a/virtinst/installertreemedia.py
+++ b/virtinst/installertreemedia.py
@@ -227,3 +227,13 @@ class InstallerTreeMedia(object):
         fetcher = self._get_fetcher(guest, None)
         cache = self._get_cached_data(guest, fetcher)
         return cache.os_variant
+
+    def requires_internet(self, guest, meter):
+        if self._media_type in [MEDIA_URL, MEDIA_DIR]:
+            return True
+
+        fetcher = self._get_fetcher(guest, meter)
+        cache = self._get_cached_data(guest, fetcher)
+        if cache.os_media:
+            return cache.os_media.requires_internet()
+        return False
-- 
2.20.1




More information about the virt-tools-list mailing list