From dd6b839330bba12888f8ba15d2555ca7fffc76ad Mon Sep 17 00:00:00 2001 From: Jana Librova Date: Thu, 13 Feb 2025 20:32:43 +0100 Subject: [PATCH] Return BuildError when kickstart file is not exists Fixes: https://pagure.io/koji/issue/4190 --- builder/kojid | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/builder/kojid b/builder/kojid index 5f192b78..b79f1db6 100755 --- a/builder/kojid +++ b/builder/kojid @@ -3299,6 +3299,9 @@ class ImageTask(BaseTaskHandler): else: kspath = self.localPath("work/%s" % ksfile) + if not os.path.exists(kspath): + raise koji.BuildError('Kickstart %s does not exist.' % kspath) + self.uploadFile(kspath) # upload the original ks file return kspath # full absolute path to the file in the chroot @@ -4042,6 +4045,10 @@ class OzImageTask(BaseTaskHandler): kspath = os.path.join(self.workdir, os.path.basename(ksfile)) with open(kspath, 'wb') as ks_dest: ks_dest.write(ks_src.read()) + + if not os.path.exists(kspath): + raise koji.BuildError('Kickstart %s does not exist.' % kspath) + self.logger.debug('uploading kickstart from here: %s' % kspath) self.uploadFile(kspath) # upload the original ks file return kspath # absolute path to the ks file