virt-manager/SOURCES/virt-manager-urlfetcher-Delete-the-isoinfo-ISOReader.patch
2021-12-09 15:43:25 +00:00

79 lines
2.5 KiB
Diff

From a3017ef3d61139362482d5f3c5d6bf056fe6fb6e Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Sat, 22 May 2021 12:18:22 -0400
Subject: [PATCH] urlfetcher: Delete the 'isoinfo' ISOReader
We didn't delete this in the last commit, mostly to make it easier
to revert this commit if it turns out we need to support both isoinfo
and xorriso. Right now I don't know of any reason why that should
be necessary but time will tell.
If we do go that route it will take more work to teach urlfetcher
to dynamically detect the presence of one or the other, along with
similar tweaks.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
(cherry picked from commit 08d1a6a2ddd18f88222f9fdffa3f60f42a40bc67)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1973236
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
---
virtinst/install/urlfetcher.py | 38 +---------------------------------
1 file changed, 1 insertion(+), 37 deletions(-)
diff --git a/virtinst/install/urlfetcher.py b/virtinst/install/urlfetcher.py
index 835c9e40..838a206a 100644
--- a/virtinst/install/urlfetcher.py
+++ b/virtinst/install/urlfetcher.py
@@ -22,45 +22,9 @@ from ..logger import log
# isoreader abstraction #
#########################
-class _ISOReader:
+class _XorrisoReader():
def __init__(self, location):
self._location = location
-
- def grabFile(self, url, scratchdir):
- raise NotImplementedError()
- def hasFile(self, url):
- raise NotImplementedError()
-
-
-class _ISOinfoReader(_ISOReader):
- """
- Handle reading reading files off an iso
- """
- def __init__(self, location):
- super().__init__(location)
- self._cache_file_list = self._make_file_list()
-
- def _make_file_list(self):
- cmd = ["isoinfo", "-J", "-i", self._location, "-f"]
-
- log.debug("Generating iso filelist: %s", cmd)
- output = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
- return output.splitlines(False)
-
- def grabFile(self, url, scratchdir):
- ignore = scratchdir
- cmd = ["isoinfo", "-J", "-i", self._location, "-x", url]
-
- log.debug("Extracting iso file: %s", cmd)
- return subprocess.check_output(cmd)
-
- def hasFile(self, url):
- return url.encode("ascii") in self._cache_file_list
-
-
-class _XorrisoReader(_ISOReader):
- def __init__(self, location):
- super().__init__(location)
self._cache_file_list = self._make_file_list()
def _make_file_list(self):
--
2.31.1