diff mbox series

[yocto-autobuilder2,04/10] builders: Fix disk space error message

Message ID 20251007-contrib-mathieu-bb-setup-links-v1-4-bb1d79289c3f@bootlin.com
State New
Headers show
Series Fix links with bitbake setup and general improvements | expand

Commit Message

Mathieu Dubois-Briand Oct. 7, 2025, 2:37 p.m. UTC
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
---
 builders.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/builders.py b/builders.py
index 0000122af015158e0cbb3a689e2419ab9c03e103..15985f258bb9fa7d38e70f4ca35f87ede4c24a23 100644
--- a/builders.py
+++ b/builders.py
@@ -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