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-dnf >= 3.2.0
|
||||
Requires: python3-librepo
|
||||
Requires: python3-pycdlib
|
||||
|
||||
%if 0%{?fedora}
|
||||
# Fedora specific deps
|
||||
|
@ -21,9 +21,10 @@ import logging
|
||||
log = logging.getLogger("livemedia-creator")
|
||||
|
||||
import os
|
||||
import pycdlib
|
||||
from pycdlib.pycdlibexception import PyCdlibException
|
||||
|
||||
from pylorax.imgutils import mount, umount
|
||||
from pylorax.executils import execWithCapture
|
||||
|
||||
class IsoMountpoint(object):
|
||||
"""
|
||||
@ -94,9 +95,9 @@ class IsoMountpoint(object):
|
||||
|
||||
Sets self.label if one is found
|
||||
"""
|
||||
isoinfo_output = execWithCapture("isoinfo", ["-d", "-i", self.iso_path])
|
||||
log.debug(isoinfo_output)
|
||||
for line in isoinfo_output.splitlines():
|
||||
if line.startswith("Volume id: "):
|
||||
self.label = line[11:]
|
||||
return
|
||||
try:
|
||||
iso = pycdlib.PyCdlib()
|
||||
iso.open(self.iso_path)
|
||||
self.label = iso.pvd.volume_identifier.decode("UTF-8").strip()
|
||||
except PyCdlibException as e:
|
||||
log.error("Problem reading label from %s: %s", self.iso_path, e)
|
||||
|
Loading…
Reference in New Issue
Block a user