unified-iso: Log better error when linking fails

When linking files fails due to target path already existing, we should
print details about the conflict.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-03-13 12:27:43 +01:00
parent 08b9d275a8
commit a1214525f5
1 changed files with 6 additions and 1 deletions

View File

@ -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