[virt-tools-list] [virt-install PATCH v2 13/14] virt-install: --unattended conflicts with --initrd-inject and --extra-args

Fabiano Fidêncio fidencio at redhat.com
Fri Feb 22 08:40:20 UTC 2019


As --unattended will take care of generating the install script to be
inject in the initrd and also of the kernel command line to be used
during the installation, we should not mix whatever user is passing as
--initrd-inject or --extra-args when using --unattended.

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 virt-install | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/virt-install b/virt-install
index 8b1d800f..0ccd3393 100755
--- a/virt-install
+++ b/virt-install
@@ -368,6 +368,10 @@ def check_option_collisions(options, guest, installer):
         fail(_("--initrd-inject only works if specified with --location.") +
              cdrom_err)
 
+    if options.unattended:
+        if options.initrd_inject or options.extra_args:
+            fail(_("--unattended does not support --initrd-inject nor --extra-args."))
+
 
 def _show_nographics_warnings(options, guest, installer):
     if guest.devices.graphics:
@@ -487,10 +491,13 @@ def build_installer(options, guest):
             install_bootdev=install_bootdev)
     if cdrom and options.livecd:
         installer.livecd = True
-    if options.extra_args:
-        installer.extra_args = options.extra_args
-    if options.initrd_inject:
-        installer.set_initrd_injections(options.initrd_inject)
+    if options.unattended:
+        pass
+    else:
+        if options.extra_args:
+            installer.extra_args = options.extra_args
+        if options.initrd_inject:
+            installer.set_initrd_injections(options.initrd_inject)
     if options.autostart:
         installer.autostart = True
 
-- 
2.20.1




More information about the virt-tools-list mailing list