Use exit code to detect wrong configs (#156)

* Update homeassistant.py

* Update homeassistant.py

* Update util.py

* add support for yaml errors
This commit is contained in:
Pascal Vizeli
2017-08-16 11:25:38 +02:00
committed by GitHub
parent 70685c41be
commit fa9b3b939e
3 changed files with 7 additions and 11 deletions

View File

@@ -103,15 +103,15 @@ class DockerHomeAssistant(DockerBase):
)
# wait until command is done
container.wait()
exit_code = container.wait()
output = container.logs()
except docker.errors.DockerException as err:
_LOGGER.error("Can't execute command -> %s", err)
return b""
return (None, b"")
# cleanup container
with suppress(docker.errors.DockerException):
container.remove(force=True)
return output
return (exit_code, output)