summaryrefslogtreecommitdiff
path: root/virt-install
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2019-11-18 11:00:45 +0100
committerCole Robinson <crobinso@redhat.com>2019-11-20 16:04:09 -0500
commitb78b8a96cfe64c6be4bbf3623bf123217baffcf2 (patch)
tree3f58cb95ec5516ac38c3625fc71a6d1d29565a7a /virt-install
parent54edd0a0a652a7cea21b203a4bc5275573998845 (diff)
downloadvirt-manager-b78b8a96cfe64c6be4bbf3623bf123217baffcf2.tar.gz
virt-install: Respect --os-variant
When the user explicitly passes --os-variant via command line, its value must be respected, always. By setting the os name earlier, we force the os-variant to be respected when the installer creates the Distro Store. Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
Diffstat (limited to 'virt-install')
-rwxr-xr-xvirt-install13
1 files changed, 8 insertions, 5 deletions
diff --git a/virt-install b/virt-install
index 82b7e537..3b4ecd2f 100755
--- a/virt-install
+++ b/virt-install
@@ -531,13 +531,16 @@ def set_explicit_guest_options(options, guest):
def installer_detect_distro(guest, installer, osdata):
try:
+ # OS name has to be set firstly whenever --os-variant is passed,
+ # otherwise it won't be respected when the installer creates the
+ # Distro Store.
+ if osdata.name:
+ guest.set_os_name(osdata.name)
+
# This also validates the install location
autodistro = installer.detect_distro(guest)
- name = osdata.name
- if osdata.is_auto:
- name = autodistro
- if name:
- guest.set_os_name(name)
+ if osdata.is_auto and autodistro:
+ guest.set_os_name(autodistro)
except ValueError as e:
fail(_("Error validating install location: %s") % str(e))