Raise an error on missing build directory

Related: https://pagure.io/koji/issue/3908
This commit is contained in:
Tomas Kopecek 2023-08-29 13:09:31 +02:00
parent b3d37d22ca
commit a171b85bed

View file

@ -5843,6 +5843,9 @@ def _set_build_volume(binfo, volinfo, strict=True):
if os.path.exists(olddir):
newdir = koji.pathinfo.build(binfo)
dir_moves.append([olddir, newdir])
elif strict:
# Shouldn't ever happen
raise koji.GenericError(f"Build directory missing: {olddir}")
for olddir, newdir in dir_moves:
# Remove old symlink if copying to base volume
if volinfo['name'] == 'DEFAULT' or volinfo['name'] is None: