Merge remote-tracking branch 'origin/dev'

This commit is contained in:
pvizeli 2017-08-16 11:38:07 +02:00
commit a94e6c5303
5 changed files with 9 additions and 13 deletions

View File

@ -87,9 +87,6 @@ def api_process_raw(content):
def api_return_error(message=None): def api_return_error(message=None):
"""Return a API error message.""" """Return a API error message."""
if message:
_LOGGER.error(message)
return web.json_response({ return web.json_response({
JSON_RESULT: RESULT_ERROR, JSON_RESULT: RESULT_ERROR,
JSON_MESSAGE: message, JSON_MESSAGE: message,

View File

@ -1,7 +1,7 @@
"""Const file for HassIO.""" """Const file for HassIO."""
from pathlib import Path from pathlib import Path
HASSIO_VERSION = '0.55' HASSIO_VERSION = '0.56'
URL_HASSIO_VERSION = ('https://raw.githubusercontent.com/home-assistant/' URL_HASSIO_VERSION = ('https://raw.githubusercontent.com/home-assistant/'
'hassio/{}/version.json') 'hassio/{}/version.json')

View File

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

View File

@ -13,7 +13,7 @@ from .validate import SCHEMA_HASS_CONFIG
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
RE_CONFIG_CHECK = re.compile(r"error", re.IGNORECASE) RE_YAML_ERROR = re.compile(r"homeassistant\.util\.yaml")
class HomeAssistant(JsonConfig): class HomeAssistant(JsonConfig):
@ -171,17 +171,16 @@ class HomeAssistant(JsonConfig):
async def check_config(self): async def check_config(self):
"""Run homeassistant config check.""" """Run homeassistant config check."""
log = await self.docker.execute_command( exit_code, log = await self.docker.execute_command(
"python3 -m homeassistant -c /config --script check_config" "python3 -m homeassistant -c /config --script check_config"
) )
# if not valid # if not valid
if not log: if exit_code is None:
return (False, "") return (False, "")
# parse output # parse output
log = convert_to_ascii(log) log = convert_to_ascii(log)
if RE_CONFIG_CHECK.search(log): if exit_code != 0 or RE_YAML_ERROR.search(log):
return (False, log) return (False, log)
return (True, log) return (True, log)

View File

@ -1,5 +1,5 @@
{ {
"hassio": "0.55", "hassio": "0.56",
"homeassistant": "0.51.2", "homeassistant": "0.51.2",
"resinos": "1.0", "resinos": "1.0",
"resinhup": "0.3", "resinhup": "0.3",