mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'bugfix/disk-data' into tweak/dashboard-storage
This commit is contained in:
commit
709539417f
@ -191,21 +191,25 @@ class Stats:
|
|||||||
# ENOENT, pop-up a Windows GUI error for a non-ready
|
# ENOENT, pop-up a Windows GUI error for a non-ready
|
||||||
# partition or just hang.
|
# partition or just hang.
|
||||||
continue
|
continue
|
||||||
usage = psutil.disk_usage(part.mountpoint)
|
try:
|
||||||
disk_data.append(
|
usage = psutil.disk_usage(part.mountpoint)
|
||||||
{
|
disk_data.append(
|
||||||
"device": part.device,
|
{
|
||||||
"total_raw": usage.total,
|
"device": part.device,
|
||||||
"total": Helpers.human_readable_file_size(usage.total),
|
"total_raw": usage.total,
|
||||||
"used_raw": usage.used,
|
"total": Helpers.human_readable_file_size(usage.total),
|
||||||
"used": Helpers.human_readable_file_size(usage.used),
|
"used_raw": usage.used,
|
||||||
"free_raw": usage.free,
|
"used": Helpers.human_readable_file_size(usage.used),
|
||||||
"free": Helpers.human_readable_file_size(usage.free),
|
"free_raw": usage.free,
|
||||||
"percent_used": usage.percent,
|
"free": Helpers.human_readable_file_size(usage.free),
|
||||||
"fs": part.fstype,
|
"percent_used": usage.percent,
|
||||||
"mount": part.mountpoint,
|
"fs": part.fstype,
|
||||||
}
|
"mount": part.mountpoint,
|
||||||
)
|
}
|
||||||
|
)
|
||||||
|
except PermissionError:
|
||||||
|
logger.debug(f"Permission error accessing {part.mountpoint}")
|
||||||
|
continue
|
||||||
|
|
||||||
return disk_data
|
return disk_data
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user