mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-21 08:06:30 +00:00
Better fix for OS error on repository reading (#2021)
This commit is contained in:
parent
c707934018
commit
6fbec53f8a
@ -75,7 +75,12 @@ class StoreData(CoreSysAttributes):
|
|||||||
def _read_addons_folder(self, path, repository):
|
def _read_addons_folder(self, path, repository):
|
||||||
"""Read data from add-ons folder."""
|
"""Read data from add-ons folder."""
|
||||||
try:
|
try:
|
||||||
addon_list = path.glob("**/config.json")
|
# Generate a list without artefact, safe for corruptions
|
||||||
|
addon_list = [
|
||||||
|
addon
|
||||||
|
for addon in path.glob("**/config.json")
|
||||||
|
if ".git" not in addon.parts
|
||||||
|
]
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
self.sys_core.healthy = False
|
self.sys_core.healthy = False
|
||||||
_LOGGER.critical(
|
_LOGGER.critical(
|
||||||
@ -85,10 +90,6 @@ class StoreData(CoreSysAttributes):
|
|||||||
return
|
return
|
||||||
|
|
||||||
for addon in addon_list:
|
for addon in addon_list:
|
||||||
# Ingore git artefacts
|
|
||||||
if ".git" in addon.parts:
|
|
||||||
continue
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
addon_config = read_json_file(addon)
|
addon_config = read_json_file(addon)
|
||||||
except JsonFileError:
|
except JsonFileError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user