From 9f70b60b199e4c3c5061a742b5d2c6e0a0e86dcd Mon Sep 17 00:00:00 2001 From: liaralabs Date: Sun, 8 Mar 2020 13:41:05 -0700 Subject: [PATCH] Fix quota display --- core/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/util.py b/core/util.py index e256e2d..3b954c0 100644 --- a/core/util.py +++ b/core/util.py @@ -174,11 +174,11 @@ def disk_usage(location): return totalh, usedh, freeh, usage def quota_usage(username): - quota = sp.Popen(('quota', '-wpu', username), stdout=sp.PIPE) + quota = sp.Popen(('sudo', 'quota', '-wpu', username), stdout=sp.PIPE) quota = quota.communicate()[0].decode("utf-8").split('\n')[2].split() fs = quota[0] - used = quota[1] - total = quota[2] + used = int(quota[1]) + total = int(quota[2]) free = total - used totalh = GetHumanReadableKB(total) usedh = GetHumanReadableKB(used)