[virt-tools-list] [virt-manager PATCH v3 4/9] installertreemedia: Pass media down to prepare_install_script()

Fabiano Fidêncio fidencio at redhat.com
Thu Mar 7 12:52:53 UTC 2019


Let's pass the media down to prepare_install_script() as it'll be used
to:
- select the preferred installation source;
- be passed down to the get_install_script() method;

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

diff --git a/virtinst/installertreemedia.py b/virtinst/installertreemedia.py
index 0b8b1383..86792503 100644
--- a/virtinst/installertreemedia.py
+++ b/virtinst/installertreemedia.py
@@ -189,7 +189,7 @@ class InstallerTreeMedia(object):
         if self._unattended_data:
             location = self.location if self._media_type == MEDIA_URL else None
             script = unattended.prepare_install_script(
-                    guest, self._unattended_data, location)
+                    guest, self._unattended_data, location, self._media)
             path, cmdline = unattended.generate_install_script(script)
 
             logging.debug("Generated unattended cmdline: %s", cmdline)
diff --git a/virtinst/unattended.py b/virtinst/unattended.py
index 6d67b210..ebfaae8a 100644
--- a/virtinst/unattended.py
+++ b/virtinst/unattended.py
@@ -228,7 +228,7 @@ class UnattendedData():
     user_password = None
 
 
-def prepare_install_script(guest, unattended_data, url=None):
+def prepare_install_script(guest, unattended_data, url=None, media=None):
     rawscript = guest.osinfo.get_install_script(unattended_data.profile)
     script = OSInstallScript(rawscript, guest.osinfo)
 
-- 
2.20.1




More information about the virt-tools-list mailing list