summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2019-06-17 00:07:29 -0400
committerCole Robinson <crobinso@redhat.com>2019-06-17 00:12:32 -0400
commit6215c86fa2f3ec485f7776005dd6811e21d10081 (patch)
tree38ed640b00a46929fefc18aec2682cfe6497c049
parente9308bde1fadd422e63b1afbf13a5b711b35c24b (diff)
downloadvirt-manager-6215c86fa2f3ec485f7776005dd6811e21d10081.tar.gz
virt-install: Warn about --location $DIR needing extra args
https://bugzilla.redhat.com/show_bug.cgi?id=1677019
-rw-r--r--tests/clitest.py5
-rw-r--r--virtinst/install/installertreemedia.py11
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)