From a1214525f5816475367be7823ce2454e256205af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 13 Mar 2017 12:27:43 +0100 Subject: [PATCH] unified-iso: Log better error when linking fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When linking files fails due to target path already existing, we should print details about the conflict. Signed-off-by: Lubomír Sedlář --- pungi_utils/unified_isos.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pungi_utils/unified_isos.py b/pungi_utils/unified_isos.py index 4254ee15..2f47159a 100644 --- a/pungi_utils/unified_isos.py +++ b/pungi_utils/unified_isos.py @@ -114,7 +114,12 @@ class UnifiedISO(object): new_path = os.path.join(self.temp_dir, "trees", arch, old_relpath) makedirs(os.path.dirname(new_path)) - self.linker.link(old_path, new_path) + try: + self.linker.link(old_path, new_path) + except OSError as exc: + print("Failed to link %s to %s: %s" % (old_path, new_path, exc.strerror), + file=sys.stderr) + raise def link_to_temp(self): # copy files to new location; change RPM location to $variant_uid