[virt-tools-list] [virt-manager PATCH 3/5] unattended: Pass OsinfoMedia to OSInstallScript

Fabiano Fidêncio fidencio at redhat.com
Fri Jul 12 13:02:21 UTC 2019


Let's pass the OsinfoMedia object down to the OSInstallScript class so
it can be used, later on, to generate the install-script and kernel
command-line specifically for the media being used.

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

diff --git a/virtinst/install/unattended.py b/virtinst/install/unattended.py
index 8e6a20c5..98bcbb21 100644
--- a/virtinst/install/unattended.py
+++ b/virtinst/install/unattended.py
@@ -125,9 +125,10 @@ class OSInstallScript:
                 return True
         return False  # pragma: no cover
 
-    def __init__(self, script, osobj):
+    def __init__(self, script, osobj, osinfomediaobj):
         self._script = script
         self._osobj = osobj
+        self._osinfomediaobj = osinfomediaobj
         self._config = None
 
         if not OSInstallScript.have_new_libosinfo():  # pragma: no cover
@@ -316,7 +317,9 @@ def prepare_install_script(guest, unattended_data,
 
     rawscript = _lookup_rawscript(guest.osinfo,
             unattended_data.profile, os_media)
-    script = OSInstallScript(rawscript, guest.osinfo)
+
+    osinfomediaobj = os_media.get_osinfo_media() if os_media else None
+    script = OSInstallScript(rawscript, guest.osinfo, osinfomediaobj)
 
     script.set_preferred_injection_method(injection_method)
 
-- 
2.21.0




More information about the virt-tools-list mailing list