mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-08-25 21:49:35 +03:00
osdict: Raise exception on get_location failure
It's better to error immediately if we know this won't work
This commit is contained in:
@ -444,12 +444,8 @@ def build_installer(options, guest):
|
||||
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)
|
||||
logging.debug(
|
||||
"Generated default libosinfo '--location %s'", location)
|
||||
options.location = location
|
||||
elif options.os_variant.install == "cdrom":
|
||||
pass
|
||||
|
@ -486,16 +486,14 @@ class _OsVariant(object):
|
||||
|
||||
treelist = self._os.get_tree_list()
|
||||
if treelist.get_length() < 1:
|
||||
logging.error(
|
||||
_("%s does not have a URL location"), self.name)
|
||||
return None
|
||||
raise RuntimeError(
|
||||
_("%s does not have a URL location") % self.name)
|
||||
|
||||
filtered_treelist = treelist.new_filtered(treefilter)
|
||||
if filtered_treelist.get_length() < 1:
|
||||
logging.error(
|
||||
_("%s does not have a URL location for the %s architecture"),
|
||||
self.name, arch)
|
||||
return None
|
||||
raise RuntimeError(
|
||||
_("%s does not have a URL location for the %s architecture") %
|
||||
(self.name, arch))
|
||||
|
||||
# Some distros have more than one URL for a specific architecture,
|
||||
# which is the case for Fedora and different variants (Server,
|
||||
|
Reference in New Issue
Block a user