virt-install: Deal with os-variant's install param

As os-variant has a new "install" parameter that can be passed, let's
take advantage of it and automatically fill options.location with data
from osinfo-db whenever install=location is passed (and, of course,
osinfo-db has the information).

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
Fabiano Fidêncio 2019-02-08 16:23:58 +01:00 committed by Cole Robinson
parent cbe84879db
commit 5f7d49d6a3

View File

@ -441,6 +441,19 @@ def build_installer(options, guest):
install_bootdev = None
has_installer = True
if options.os_variant.install == "location":
if not options.location:
location = guest.osinfo.get_location(guest.os.arch)
if not location:
logging.debug(_("No location could be guessed from osinfo-db "
"and the installation cannot proceed"))
# This triggers an error in validate_required_options
return None
logging.debug("Generated default libosinfo '--location %s'", location)
options.location = location
elif options.os_variant.install == "cdrom":
pass
if options.location:
(location,
location_kernel,