@@ -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
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> --- builders.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)