From 7c2743fb50b23245bf027e363bde64f13d83ad6b Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Mon, 1 Jun 2020 12:42:53 +0800 Subject: [PATCH] Include the output of getisoimage in the error message JIRA: RHELCMP-720 Signed-off-by: Haibo Lin --- pungi_utils/unified_isos.py | 7 ++++++- tests/test_unified_isos.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pungi_utils/unified_isos.py b/pungi_utils/unified_isos.py index 1a5287e4..2a60b5f9 100644 --- a/pungi_utils/unified_isos.py +++ b/pungi_utils/unified_isos.py @@ -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 diff --git a/tests/test_unified_isos.py b/tests/test_unified_isos.py index 9aa3d779..4952539b 100755 --- a/tests/test_unified_isos.py +++ b/tests/test_unified_isos.py @@ -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), ]