Log platform import errors and correct reqs for config check (#25425)

* Log failures to load plaforms

* Drop unused exception variable

* Also load pip requirements with check config

* Fix lint

* More lint

* Drop invalid parameters for error call
pull/25561/head
Joakim Plate 2019-07-31 18:09:00 +02:00 committed by Paulus Schoutsen
parent 35c048fe6b
commit 3d11c45edd
2 changed files with 12 additions and 0 deletions

View File

@ -706,11 +706,14 @@ async def async_process_component_config(
if (not hass.config.skip_pip and p_integration.requirements and
not await async_process_requirements(
hass, p_integration.domain, p_integration.requirements)):
_LOGGER.error(
"Unable to install all requirements for %s.%s", domain, p_name)
continue
try:
platform = p_integration.get_platform(domain)
except ImportError:
_LOGGER.exception("Failed to get platform %s.%s", domain, p_name)
continue
# Validate platform specific schema

View File

@ -159,6 +159,15 @@ async def async_check_ha_config_file(hass: HomeAssistant) -> \
"platform.".format(p_name, domain))
continue
if (not hass.config.skip_pip and p_integration.requirements and
not await requirements.async_process_requirements(
hass, p_integration.domain,
p_integration.requirements)):
result.add_error(
"Unable to install all requirements: {}".format(
', '.join(integration.requirements)))
continue
try:
platform = p_integration.get_platform(domain)
except ImportError: