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>
This commit is contained in:
parent
54edd0a0a6
commit
b78b8a96cf
13
virt-install
13
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))
|
||||
|
||||
|
|
Loading…
Reference in New Issue