summaryrefslogtreecommitdiff
path: root/virt-install
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2019-06-13 18:29:39 -0400
committerCole Robinson <crobinso@redhat.com>2019-06-13 18:29:39 -0400
commitee119c3bb239c287f6c98d7f1f2bf5b94060f828 (patch)
tree1592bf68e08cee15e74ceb810b8e2d596ca16a30 /virt-install
parentd9729855eeb3e721b46aa3bab6eec6c04cc84066 (diff)
downloadvirt-manager-ee119c3bb239c287f6c98d7f1f2bf5b94060f828.tar.gz
guest: Add skip_default_osinfo
We set this to True in virt-install, which will cause an explicit error to be thrown if some part of the cli parser tries to access osinfo before it's been set, because then we have a circular dependency between cli config -> installer -> osinfo -> cli config
Diffstat (limited to 'virt-install')
-rwxr-xr-xvirt-install11
1 files changed, 7 insertions, 4 deletions
diff --git a/virt-install b/virt-install
index 03ed324e..57875b0e 100755
--- a/virt-install
+++ b/virt-install
@@ -507,6 +507,7 @@ def set_cli_defaults(options, guest):
def build_guest_instance(conn, options):
guest = virtinst.Guest(conn)
+ guest.skip_default_osinfo = True
if options.name:
guest.name = options.name
@@ -523,10 +524,6 @@ def build_guest_instance(conn, options):
if options.machine:
guest.os.machine = options.machine
- # If explicit os-variant requested, set it early since it will
- # provide more defaults in the future
- options.os_variant.set_os_name(guest)
-
cli.parse_option_strings(options, guest, None)
# Call set_capabilities_defaults explicitly here rather than depend
@@ -534,6 +531,12 @@ def build_guest_instance(conn, options):
# However we want to do it after parse_option_strings to ensure
# we are operating on any arch/os/type values passed in with --boot
guest.set_capabilities_defaults()
+
+ # If explicit os-variant requested, set it early since it will
+ # provide more defaults in the future
+ guest.set_default_os_name()
+ options.os_variant.set_os_name(guest)
+
installer = build_installer(options, guest)
set_cli_defaults(options, guest)