From 2328e605b792d65813d07e0845385028f004e27b Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Mon, 5 Oct 2020 10:03:10 +0200 Subject: [PATCH] parse disk size as int before multiplying --- setup-scripts/health-checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-scripts/health-checker.py b/setup-scripts/health-checker.py index 1ff5d4ef..3c9c18fd 100755 --- a/setup-scripts/health-checker.py +++ b/setup-scripts/health-checker.py @@ -79,7 +79,7 @@ async def check_disk(): for line in df.split("\n")[1:]: fields = list(filter(None, line.split(" "))) # -1 is "mounted on", 3 is "available space" in KiB which we want in bytes - volumes[fields[-1]] = fields[3] * 1024 + volumes[fields[-1]] = int(fields[3]) * 1024 # List of mount point, longest to shortest. We'll use that to find the best # fit for the volume we want to check. mount_points = sorted(volumes.keys(), key=len, reverse=True)