Include the output of getisoimage in the error message

JIRA: RHELCMP-720
Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
Haibo Lin 2020-06-01 12:42:53 +08:00
parent d6caf0785b
commit 7c2743fb50
2 changed files with 7 additions and 2 deletions

View File

@ -94,6 +94,10 @@ class UnifiedISO(object):
self.createiso()
self.update_checksums()
self.dump_manifest()
except RuntimeError as exc:
if hasattr(exc, "output"):
print(exc.output)
raise
finally:
if delete_temp:
shutil.rmtree(self.temp_dir)
@ -377,7 +381,8 @@ class UnifiedISO(object):
run(
iso.get_mkisofs_cmd(
iso_path, [source_dir], volid=volid, exclude=["./lost+found"]
)
),
universal_newlines=True,
)
# implant MD5

View File

@ -620,7 +620,7 @@ class TestCreateiso(PungiTestCase):
self.assertEqual(
run.mock_calls,
[
mock.call(self.mkisofs_cmd),
mock.call(self.mkisofs_cmd, universal_newlines=True),
mock.call(iso.get_implantisomd5_cmd.return_value),
mock.call(iso.get_manifest_cmd.return_value),
]