Blame SOURCES/virt-manager-urlfetcher-Delete-the-isoinfo-ISOReader.patch

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