mirror of
https://github.com/home-assistant/core.git
synced 2025-08-28 08:51:41 +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:
committed by
Franck Nijhof
parent
175e07fe3b
commit
7c06f05108
@@ -25,6 +25,11 @@ def get_all_disk_mounts() -> set[str]:
|
|||||||
"No permission for running user to access %s", part.mountpoint
|
"No permission for running user to access %s", part.mountpoint
|
||||||
)
|
)
|
||||||
continue
|
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 != "":
|
if usage.total > 0 and part.device != "":
|
||||||
disks.add(part.mountpoint)
|
disks.add(part.mountpoint)
|
||||||
_LOGGER.debug("Adding disks: %s", ", ".join(disks))
|
_LOGGER.debug("Adding disks: %s", ", ".join(disks))
|
||||||
|
Reference in New Issue
Block a user