Skip disk types in System Monitor (#107943)
* Skip disk types in System Monitor * change backpull/107960/head^2
parent
c49246dd07
commit
1d2c23d81c
|
@ -7,6 +7,8 @@ import psutil
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
SKIP_DISK_TYPES = {"proc", "tmpfs", "devtmpfs"}
|
||||||
|
|
||||||
|
|
||||||
def get_all_disk_mounts() -> set[str]:
|
def get_all_disk_mounts() -> set[str]:
|
||||||
"""Return all disk mount points on system."""
|
"""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
|
# ENOENT, pop-up a Windows GUI error for a non-ready
|
||||||
# partition or just hang.
|
# partition or just hang.
|
||||||
continue
|
continue
|
||||||
|
if part.fstype in SKIP_DISK_TYPES:
|
||||||
|
# Ignore disks which are memory
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
usage = psutil.disk_usage(part.mountpoint)
|
usage = psutil.disk_usage(part.mountpoint)
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
|
|
Loading…
Reference in New Issue