Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 1cb8bec

Browse files
committed
Set Guest.os_variant if detect from install media (and user doesn't override).
1 parent dbfd812 commit 1cb8bec

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

virtinst/DistroInstaller.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,20 @@ def _prepare_kernel_and_initrd(self, guest, distro, meter):
176176
# Need to fetch the kernel & initrd from a remote site, or
177177
# out of a loopback mounted disk image/device
178178

179-
(kernelfn, initrdfn, args), os_type = OSDistro.acquireKernel(guest,
179+
((kernelfn, initrdfn, args),
180+
os_type, os_variant) = OSDistro.acquireKernel(guest,
180181
self.location, meter, guest.arch, scratchdir=self.scratchdir,
181182
type=self.os_type, distro=distro)
182183

183184
# Only set OS type if the user didn't explictly pass one
185+
# XXX: Should this be opt in?
184186
if guest.os_type == None and os_type:
187+
logging.debug("Auto detected OS type as: %s" % os_type)
185188
guest.os_type = os_type
189+
if (guest.os_variant == None and os_variant
190+
and guest.os_type == os_type):
191+
logging.debug("Auto detected OS variant as: %s" % os_variant)
192+
guest.os_variant = os_variant
186193

187194
self.install["kernel"] = kernelfn
188195
self.install["initrd"] = initrdfn

virtinst/OSDistro.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ def _acquireMedia(iskernel, guest, baseuri, progresscb, arch,
114114
scratchdir=scratchdir, arch=arch)
115115

116116
if iskernel is True:
117+
# FIXME: We should probably do this for both kernel and boot
118+
# disk?
117119
return (store.acquireKernel(guest, fetcher, progresscb),
118-
store.os_type)
120+
store.os_type, store.os_variant)
119121
elif iskernel is False:
120122
return store.acquireBootDisk(fetcher, progresscb)
121123
else:

0 commit comments

Comments
 (0)