From 6215c86fa2f3ec485f7776005dd6811e21d10081 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 17 Jun 2019 00:07:29 -0400 Subject: virt-install: Warn about --location $DIR needing extra args https://bugzilla.redhat.com/show_bug.cgi?id=1677019 --- tests/clitest.py | 5 ++--- virtinst/install/installertreemedia.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/clitest.py b/tests/clitest.py index e3a91618..9f373fc4 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -1074,9 +1074,8 @@ c.add_valid("--pxe --destroy-on-exit", grep="Restarting guest.\n") # destroy-on c.add_valid("--pxe --transient --destroy-on-exit", grep="Domain creation completed.") # destroy-on-exit + transient c.add_valid("--pxe --graphics vnc --noreboot", grep="testsuite console command: ['virt-viewer'") # mock virt-viewer waiting, with noreboot magic c.add_valid("--nographics --cdrom %(EXISTIMG1)s") # console warning about cdrom + nographics -c.add_valid("--nographics --console none --location %(TREEDIR)s") # console warning about nographics + --console none -c.add_valid("--nographics --console none --location %(TREEDIR)s") # console warning about nographics + --console none -c.add_valid("--nographics --location %(TREEDIR)s") # console warning about nographics + missing extra args +c.add_valid("--nographics --console none --location %(TREEDIR)s", grep="No --console device added") # console warning about nographics + --console none +c.add_valid("--nographics --console none --location %(TREEDIR)s", grep="Directory tree installs typically") # warning about directory trees not working well c.add_valid("--pxe --nographics --transient", grep="testsuite console command: ['virsh'") # --transient handling diff --git a/virtinst/install/installertreemedia.py b/virtinst/install/installertreemedia.py index 6ed9ddec..4f8d336c 100644 --- a/virtinst/install/installertreemedia.py +++ b/virtinst/install/installertreemedia.py @@ -248,8 +248,15 @@ class InstallerTreeMedia(object): self._extra_args.append(install_args) if self._install_kernel_args: - return self._install_kernel_args - return " ".join(self._extra_args) + ret = self._install_kernel_args + else: + ret = " ".join(self._extra_args) + + if self._media_type == MEDIA_DIR and not ret: + log.warning(_("Directory tree installs typically do not work " + "unless extra kernel args are passed to point the " + "installer at a network accessible install tree.")) + return ret def prepare(self, guest, meter, unattended_script): fetcher = self._get_fetcher(guest, meter) -- cgit v1.2.1