[virt-tools-list] [virt-manager PATCH v2 22/25] installertremeedia: Add an internel _media to the object

Fabiano Fidêncio fidencio at redhat.com
Tue Feb 26 09:43:53 UTC 2019


Let's add an internal Libosinfo.OsMedia attribute to the
InstallerTreeMedia object.

By doing this, it'll help us in the future to:
- easily get the media's kernel/initrd path
- pass down the media to the generate_install_script()

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

diff --git a/virtinst/installertreemedia.py b/virtinst/installertreemedia.py
index 2484e88c..2988c198 100644
--- a/virtinst/installertreemedia.py
+++ b/virtinst/installertreemedia.py
@@ -80,6 +80,8 @@ class InstallerTreeMedia(object):
         self._tmpfiles = []
         self._tmpvols = []
 
+        # A Libosinfo.OsinfoMedia
+        self._media = None
         self._unattended_data = None
 
         self._media_type = MEDIA_ISO
@@ -96,6 +98,9 @@ class InstallerTreeMedia(object):
 
         if self._media_type == MEDIA_ISO:
             InstallerTreeMedia.validate_path(self.conn, self.location)
+            osguess = OSDB.guess_os_by_iso(self.location)
+            if osguess:
+                self._media = osguess[1]
 
 
     ########################
-- 
2.20.1




More information about the virt-tools-list mailing list