mirror of
https://github.com/swizzin/swizzin_dashboard.git
synced 2024-09-20 14:56:08 +08:00
Fix quota display
This commit is contained in:
parent
21e429f84c
commit
9f70b60b19
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue