mirror of
https://github.com/home-assistant/core
synced 2024-09-12 15:16:21 +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:
parent
d19037a36b
commit
840089b8ac
@ -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))
|
||||||
|
Loading…
Reference in New Issue
Block a user