1
mirror of https://github.com/home-assistant/core synced 2024-07-15 09:42:11 +02:00

Handle OSError during setup for System Monitor (#107396)

* Handle OSError during setup for System Monitor

* Clean string copy

* debug

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
G Johansson 2024-01-07 13:15:34 +01:00 committed by GitHub
parent d19037a36b
commit 840089b8ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,11 @@ def get_all_disk_mounts() -> set[str]:
"No permission for running user to access %s", part.mountpoint
)
continue
except OSError as err:
_LOGGER.debug(
"Mountpoint %s was excluded because of: %s", part.mountpoint, err
)
continue
if usage.total > 0 and part.device != "":
disks.add(part.mountpoint)
_LOGGER.debug("Adding disks: %s", ", ".join(disks))