Replace isoinfo with pycdlib
isoinfo is part of genisoimage, which we no longer use, switch to using a python library to read the label from the iso.
This commit is contained in:
parent
123b5c269d
commit
d4d050496b
@ -49,6 +49,7 @@ Requires: python3-mako
|
|||||||
Requires: python3-kickstart >= 3.19
|
Requires: python3-kickstart >= 3.19
|
||||||
Requires: python3-dnf >= 3.2.0
|
Requires: python3-dnf >= 3.2.0
|
||||||
Requires: python3-librepo
|
Requires: python3-librepo
|
||||||
|
Requires: python3-pycdlib
|
||||||
|
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
# Fedora specific deps
|
# Fedora specific deps
|
||||||
|
@ -21,9 +21,10 @@ import logging
|
|||||||
log = logging.getLogger("livemedia-creator")
|
log = logging.getLogger("livemedia-creator")
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import pycdlib
|
||||||
|
from pycdlib.pycdlibexception import PyCdlibException
|
||||||
|
|
||||||
from pylorax.imgutils import mount, umount
|
from pylorax.imgutils import mount, umount
|
||||||
from pylorax.executils import execWithCapture
|
|
||||||
|
|
||||||
class IsoMountpoint(object):
|
class IsoMountpoint(object):
|
||||||
"""
|
"""
|
||||||
@ -94,9 +95,9 @@ class IsoMountpoint(object):
|
|||||||
|
|
||||||
Sets self.label if one is found
|
Sets self.label if one is found
|
||||||
"""
|
"""
|
||||||
isoinfo_output = execWithCapture("isoinfo", ["-d", "-i", self.iso_path])
|
try:
|
||||||
log.debug(isoinfo_output)
|
iso = pycdlib.PyCdlib()
|
||||||
for line in isoinfo_output.splitlines():
|
iso.open(self.iso_path)
|
||||||
if line.startswith("Volume id: "):
|
self.label = iso.pvd.volume_identifier.decode("UTF-8").strip()
|
||||||
self.label = line[11:]
|
except PyCdlibException as e:
|
||||||
return
|
log.error("Problem reading label from %s: %s", self.iso_path, e)
|
||||||
|
Loading…
Reference in New Issue
Block a user