[virt-tools-list] [virt-manager PATCH v2 20/25] unattended: Adapt the installation_source on generate_install_script()

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

In case a media is passed, the installation should be performed
using the media itself instead of network.

Mind that it doesn't mean that network may not be required when
performing a media installation, it just means that the primary method
to be used is the media.

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

diff --git a/virtinst/unattended.py b/virtinst/unattended.py
index dd8e2033..609f5934 100644
--- a/virtinst/unattended.py
+++ b/virtinst/unattended.py
@@ -27,7 +27,9 @@ def generate_install_script(guest, unattended_data, media=None):
     # and install the systems via network.
             script, "initrd")
-    guest.osinfo.set_install_script_installation_source(script, "network")
+    installation_source = "media" if media else "network"
+    guest.osinfo.set_install_script_installation_source(
+            script, installation_source)
     config = guest.osinfo.get_install_script_config(
             script, unattended_data, guest.os.arch, guest.name)

More information about the virt-tools-list mailing list