[virt-tools-list] [virt-manager PATCH v2] virt-install: report an error for pxe install without network
Pavel Hrdina
phrdina at redhat.com
Thu Aug 6 12:43:00 UTC 2015
Fix a regression where we used to report an error message if user
specified pxe installation without any network (--nonetworks or
--network none).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1250382
Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
tests/clitest.py | 2 +-
virt-install | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/clitest.py b/tests/clitest.py
index fb63191..6c308c8 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -746,8 +746,8 @@ c.add_valid("--mac 22:22:33:44:55:AF") # Just a macaddr
c.add_valid("--bridge mybr0 --mac 22:22:33:44:55:AF") # Old bridge w/ mac
c.add_valid("--network bridge:mybr0,model=e1000") # --network bridge:
c.add_valid("--network network:default --mac RANDOM") # VirtualNetwork with a random macaddr
-c.add_valid("--nonetworks") # no networks
c.add_valid("--vnc --keymap=local") # --keymap local
+c.add_invalid("--nonetworks") # no networks
c.add_invalid("--graphics vnc --vnclisten 1.2.3.4") # mixing old and new
c.add_invalid("--network=FOO") # Nonexistent network
c.add_invalid("--mac 1234") # Invalid mac
diff --git a/virt-install b/virt-install
index 6894654..0e6e750 100755
--- a/virt-install
+++ b/virt-install
@@ -226,6 +226,9 @@ def convert_old_networks(options):
fail(_("Cannot use --nonetworks with --network"))
options.network = ["none"]
+ if options.pxe and options.network and "none" in options.network:
+ fail(_("Can't use --pxe without any network"))
+
macs = virtinst.util.listify(options.mac)
networks = virtinst.util.listify(options.network)
bridges = virtinst.util.listify(options.bridge)
--
2.5.0
More information about the virt-tools-list
mailing list