installtreemedia: Grab libosinfo media from urldetect

This will be needed for upcoming unattended changes
This commit is contained in:
Cole Robinson 2019-03-08 17:01:26 -05:00
parent 9c5d252a2c
commit b2402b278a
2 changed files with 13 additions and 2 deletions

View File

@ -30,9 +30,11 @@ def _is_url(url):
class _LocationData(object):
def __init__(self, os_variant, kernel_pairs):
def __init__(self, os_variant, kernel_pairs, osinfo_media):
self.os_variant = os_variant
self.kernel_pairs = kernel_pairs
self.osinfo_media = osinfo_media
self.kernel_url_arg = None
if self.os_variant:
osobj = OSDB.lookup_os(self.os_variant)
@ -122,15 +124,18 @@ class InstallerTreeMedia(object):
skip_error=has_location_kernel)
os_variant = None
osinfo_media = None
kernel_paths = []
if store:
kernel_paths = store.get_kernel_paths()
os_variant = store.get_osdict_info()
osinfo_media = store.get_osinfo_media()
if has_location_kernel:
kernel_paths = [
(self._location_kernel, self._location_initrd)]
self._cached_data = _LocationData(os_variant, kernel_paths)
self._cached_data = _LocationData(os_variant, kernel_paths,
osinfo_media)
return self._cached_data
def _prepare_kernel_url(self, guest, fetcher):

View File

@ -367,6 +367,12 @@ class _DistroTree(object):
"""
return self._os_variant
def get_osinfo_media(self):
"""
Return detected libosinfo media object
"""
return self.cache.libosinfo_mediaobj
class _FedoraDistro(_DistroTree):
PRETTY_NAME = "Fedora"