diff mbox series

[yocto-autobuilder2] builders: Remove confusing newlines from log messages

Message ID 20250917112137.1884344-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series [yocto-autobuilder2] builders: Remove confusing newlines from log messages | expand

Commit Message

Richard Purdie Sept. 17, 2025, 11:21 a.m. UTC
The log messages contained newlines which made the logs hard to read. Tweak the
code to avoid this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 builders.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/builders.py b/builders.py
index e4763d53..d26b7e9d 100644
--- a/builders.py
+++ b/builders.py
@@ -79,12 +79,13 @@  def canStartBuild(builder, wfb, request):
         threshold = threshold * 1024 *1024 * 1024
 
         cmd = yield shell("findmnt -T %s --df -n --bytes | awk '{print $5}'" % mountpoint, wfb.worker, builder)
-        if int(cmd.stdout) < threshold:
-            log.msg("Detected {0} GB of space available on {1}, less than threshold of {2} GB. Can't start build".format(cmd.stdout, name, threshold))
+        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))
             wfb.worker.quarantine_timeout = 10 * 60
             wfb.worker.putInQuarantine()
             return False
-        log.msg("Detected {0} GB of space available for {1}, more than threshold of {2} GB".format(cmd.stdout, name, threshold))
+        log.msg("Detected {0} GB of space available for {1}, more than threshold of {2} GB".format(space, name, threshold))
 
     log.msg("OK to build")
     if wfb.worker.isPaused():