Skip disk types in System Monitor (#107943)

* Skip disk types in System Monitor

* change back
This commit is contained in:
G Johansson 2024-01-13 14:34:24 +01:00 committed by Franck Nijhof
parent c0c9fb0f00
commit 80387be061
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3

View file

@ -7,6 +7,8 @@ import psutil
_LOGGER = logging.getLogger(__name__)
SKIP_DISK_TYPES = {"proc", "tmpfs", "devtmpfs"}
def get_all_disk_mounts() -> set[str]:
"""Return all disk mount points on system."""
@ -18,6 +20,9 @@ def get_all_disk_mounts() -> set[str]:
# ENOENT, pop-up a Windows GUI error for a non-ready
# partition or just hang.
continue
if part.fstype in SKIP_DISK_TYPES:
# Ignore disks which are memory
continue
try:
usage = psutil.disk_usage(part.mountpoint)
except PermissionError: