From 3e263f33f2bd00f6aeac3f72627ae59efd901ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 11 Sep 2019 15:36:28 +0200 Subject: [PATCH] Resolve symlinks to images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Koji started to create relative symlinks to images created in various tasks. We need to check for that and potentially link the actual file. JIRA: COMPOSE-3822 Signed-off-by: Lubomír Sedlář --- pungi/phases/image_build.py | 4 +++- pungi/phases/livemedia_phase.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pungi/phases/image_build.py b/pungi/phases/image_build.py index 22c60afe..3b4eeacf 100644 --- a/pungi/phases/image_build.py +++ b/pungi/phases/image_build.py @@ -243,7 +243,9 @@ class CreateImageBuildThread(WorkerThread): # let's not change filename of koji outputs image_dest = os.path.join(image_dir, os.path.basename(image_info['path'])) - linker.link(image_info['path'], image_dest, link_type=cmd["link_type"]) + + src_file = os.path.realpath(image_info["path"]) + linker.link(src_file, image_dest, link_type=cmd["link_type"]) # Update image manifest img = Image(compose.im) diff --git a/pungi/phases/livemedia_phase.py b/pungi/phases/livemedia_phase.py index 7878401f..2057cb61 100644 --- a/pungi/phases/livemedia_phase.py +++ b/pungi/phases/livemedia_phase.py @@ -160,7 +160,9 @@ class LiveMediaThread(WorkerThread): # let's not change filename of koji outputs image_dest = os.path.join(image_dir, os.path.basename(image_info['path'])) - linker.link(image_info['path'], image_dest, link_type=link_type) + + src_file = os.path.realpath(image_info["path"]) + linker.link(src_file, image_dest, link_type=link_type) # Update image manifest img = Image(compose.im)