Skip to content

Commit

Permalink
Make sure we properly address the percent used.
Browse files Browse the repository at this point in the history
When we have a device with multiple paritions make sure the percentage
calculation is correct.
  • Loading branch information
JeffCurless committed May 2, 2023
1 parent d61fa74 commit 83c3a07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion argonsysinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ def argonsysinfo_listhddusage():

outputobj[curdev]["used"] += int(infolist[2])
outputobj[curdev]["total"] += int(infolist[1])
outputobj[curdev]["percent"] += int(percent)
outputobj[curdev]["percent"] = round(((outputobj[curdev]["used"]/outputobj[curdev]["total"]) * 100),1)
#outputobj[curdev]["percent"] += int(percent)

return outputobj

def argonsysinfo_kbstr(kbval, wholenumbers = True):
Expand Down

0 comments on commit 83c3a07

Please sign in to comment.