Fix quota display

This commit is contained in:
liaralabs 2020-03-08 13:41:05 -07:00
parent 21e429f84c
commit 9f70b60b19

View file

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