Cleanup variant specifics and version checks

This commit is contained in:
lumarel 2021-12-05 21:00:21 +01:00
parent c0aaa0597b
commit 46dc6364c1

View File

@ -221,10 +221,7 @@ class VirtInstallImage(object):
if variant: if variant:
self.variant = variant self.variant = variant
else: else:
if str(release).isdigit() and int(release) < 24: self.variant = "BaseOS"
self.variant = "Server"
else:
self.variant = "Everything"
self.bootopts = bootopts self.bootopts = bootopts
@property @property
@ -284,25 +281,18 @@ class VirtInstallImage(object):
tmpfile = "{0}.tmp".format(self.filename) tmpfile = "{0}.tmp".format(self.filename)
arch = self.arch arch = self.arch
rockydir = 'rocky/linux' rockydir = 'rocky'
memsize = '3072' memsize = '3072'
if arch == 'i686':
arch = 'i386'
if arch in ['ppc64','ppc64le']: if arch in ['ppc64','ppc64le']:
rockydir = 'rocky-secondary'
memsize = '4096' memsize = '4096'
if arch == 'i386':
# i686 is in rocky-secondary (until it died)
rockydir = 'rocky-secondary'
variant = self.variant variant = self.variant
# From F31 onwards, Workstation tree is not installable and we if variant == 'Workstation':
# build Workstation images out of Everything variant = 'BaseOS'
# We will always use the dvd1 ISO and the closest behavior is the Everything variant
variant = 'Everything'
try: try:
# loctmp is the Distribution tree installation source. Point at the good location # loctmp is the Distribution tree installation source. Point at the good location
loctmp = "https://download.rockylinux.org/pub/rocky/{0}/BaseOS/{1}/os" loctmp = "https://dl.rockylinux.org/pub/{0}/{1}/{2}/{3}/os/"
ksfile = self.kickstart_file ksfile = self.kickstart_file
xargs = "inst.ks=file:/{0}".format(ksfile) xargs = "inst.ks=file:/{0}".format(ksfile)
args = ["virt-install", "--disk", "size={0},path={1}".format(self.size, tmpfile), args = ["virt-install", "--disk", "size={0},path={1}".format(self.size, tmpfile),
@ -486,8 +476,6 @@ def get_virtinstall_images(imggrp, nextrel=None, releases=None):
rels = [release] rels = [release]
for arch in arches: for arch in arches:
for rel in rels: for rel in rels:
if arch == 'i686' and int(rel) > 8:
continue
key = "{0}-{1}".format(rel, arch) key = "{0}-{1}".format(rel, arch)
# using a dict here avoids dupes # using a dict here avoids dupes
imgs[key] = VirtInstallImage(name, rel, arch, variant=variant, size=size, imgs[key] = VirtInstallImage(name, rel, arch, variant=variant, size=size,