1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Allow IntegrationNotFound when checking config in safe mode (#56283)

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
J. Nick Koston
2021-09-17 19:25:50 -10:00
committed by GitHub
parent bad6b2f7f5
commit eb98ac9415
3 changed files with 64 additions and 5 deletions

View File

@@ -125,8 +125,12 @@ async def async_check_ha_config_file( # noqa: C901
for domain in components:
try:
integration = await async_get_integration_with_requirements(hass, domain)
except (RequirementsNotFound, loader.IntegrationNotFound) as ex:
result.add_error(f"Component error: {domain} - {ex}")
except loader.IntegrationNotFound as ex:
if not hass.config.safe_mode:
result.add_error(f"Integration error: {domain} - {ex}")
continue
except RequirementsNotFound as ex:
result.add_error(f"Integration error: {domain} - {ex}")
continue
try:
@@ -210,8 +214,11 @@ async def async_check_ha_config_file( # noqa: C901
hass, p_name
)
platform = p_integration.get_platform(domain)
except loader.IntegrationNotFound as ex:
if not hass.config.safe_mode:
result.add_error(f"Platform error {domain}.{p_name} - {ex}")
continue
except (
loader.IntegrationNotFound,
RequirementsNotFound,
ImportError,
) as ex: