Log config check (#1583)

* Add more log for config check to debug

* Convert to ascii

* fix comment
This commit is contained in:
Pascal Vizeli 2020-03-12 15:16:40 +01:00 committed by GitHub
parent 98b969ef06
commit 4a20344652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -465,13 +465,16 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
"python3 -m homeassistant -c /config --script check_config"
)
# if not valid
# If not valid
if result.exit_code is None:
_LOGGER.error("Fatal error on config check!")
raise HomeAssistantError()
# parse output
# Convert output
log = convert_to_ascii(result.output)
_LOGGER.debug("Result config check: %s", log.strip())
# Parse output
if result.exit_code != 0 or RE_YAML_ERROR.search(log):
_LOGGER.error("Invalid Home Assistant config found!")
return ConfigResult(False, log)