parse disk size as int before multiplying

This commit is contained in:
Karol Wypchlo 2020-10-05 10:03:10 +02:00
parent e58752571e
commit 2328e605b7
1 changed files with 1 additions and 1 deletions

View File

@ -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)