osinfo: use the OS kernel-url-argument if available

Each OS may specify which kernel argument is needed to specify the
installation source; use it as primary source, falling back to the
current logic. This should help supporting new OSes OOTB.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
Pino Toscano 2021-11-01 15:06:04 +01:00 committed by Daniel Berrangé
parent 2e2d3b84bc
commit 0038d750c9
1 changed files with 6 additions and 0 deletions

View File

@ -593,6 +593,12 @@ class _OsVariant(object):
Kernel argument name the distro's installer uses to reference
a network source, possibly bypassing some installer prompts
"""
# Let's ask the OS for its kernel argument for the source
if hasattr(self._os, "get_kernel_url_argument"):
osarg = self._os.get_kernel_url_argument()
if osarg is not None:
return osarg
# SUSE distros
if self.distro in ["caasp", "sle", "sled", "sles", "opensuse"]:
return "install"