builders: Fix disk space error message

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Mathieu Dubois-Briand 2025-10-16 15:20:12 +02:00 committed by Richard Purdie
parent 4397ebf306
commit 1ee8bfa19c

View File

@ -77,12 +77,12 @@ def canStartBuild(builder, wfb, request):
for mountpoint in checks:
threshold, name = checks[mountpoint]
threshold = threshold * 1024 *1024 * 1024
bytes_in_gb = 1024 * 1024 * 1024
cmd = yield shell("findmnt -T %s --df -n --bytes | awk '{print $5}'" % mountpoint, wfb.worker, builder)
space = int(cmd.stdout.strip())
if space < threshold:
log.msg("Detected {0} GB of space available on {1}, less than threshold of {2} GB. Can't start build".format(space, name, threshold))
if space < threshold * bytes_in_gb:
log.msg("Detected {0} GB of space available on {1}, less than threshold of {2} GB. Can't start build".format(space / bytes_in_gb, name, threshold))
wfb.worker.quarantine_timeout = 10 * 60
wfb.worker.putInQuarantine()
return False