Add missing disks to Systemmonitor (#106541)
This commit is contained in:
parent
2abf7d75e9
commit
353f33f4ac
1 changed files with 4 additions and 2 deletions
|
@ -11,14 +11,16 @@ _LOGGER = logging.getLogger(__name__)
|
|||
def get_all_disk_mounts() -> list[str]:
|
||||
"""Return all disk mount points on system."""
|
||||
disks: list[str] = []
|
||||
for part in psutil.disk_partitions(all=False):
|
||||
for part in psutil.disk_partitions(all=True):
|
||||
if os.name == "nt":
|
||||
if "cdrom" in part.opts or part.fstype == "":
|
||||
# skip cd-rom drives with no disk in it; they may raise
|
||||
# ENOENT, pop-up a Windows GUI error for a non-ready
|
||||
# partition or just hang.
|
||||
continue
|
||||
disks.append(part.mountpoint)
|
||||
usage = psutil.disk_usage(part.mountpoint)
|
||||
if usage.total > 0 and part.device != "":
|
||||
disks.append(part.mountpoint)
|
||||
_LOGGER.debug("Adding disks: %s", ", ".join(disks))
|
||||
return disks
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue