Merge pull request #438 from NebulousLabs/fix-disk-checker

parse disk size as int before multiplying
This commit is contained in:
Karol Wypchło 2020-10-05 10:05:16 +02:00 committed by GitHub
commit 4bc566ea97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)