mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Handle no permission for disks in Systemmonitor (#106653)
This commit is contained in:
parent
767c55fbac
commit
494dd2ef07
@ -18,7 +18,13 @@ def get_all_disk_mounts() -> set[str]:
|
||||
# ENOENT, pop-up a Windows GUI error for a non-ready
|
||||
# partition or just hang.
|
||||
continue
|
||||
usage = psutil.disk_usage(part.mountpoint)
|
||||
try:
|
||||
usage = psutil.disk_usage(part.mountpoint)
|
||||
except PermissionError:
|
||||
_LOGGER.debug(
|
||||
"No permission for running user to access %s", part.mountpoint
|
||||
)
|
||||
continue
|
||||
if usage.total > 0 and part.device != "":
|
||||
disks.add(part.mountpoint)
|
||||
_LOGGER.debug("Adding disks: %s", ", ".join(disks))
|
||||
|
Loading…
x
Reference in New Issue
Block a user