From df3e9e3a5e34beb4ef265b9652378f19cd9a12a5 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 23 Oct 2019 16:02:42 +0200 Subject: [PATCH 1/5] Bump version 192 --- hassio/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hassio/const.py b/hassio/const.py index fdedb7323..6a2887376 100644 --- a/hassio/const.py +++ b/hassio/const.py @@ -2,7 +2,7 @@ from pathlib import Path from ipaddress import ip_network -HASSIO_VERSION = "191" +HASSIO_VERSION = "192" URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons" From 7b8ad0782d066a83ad9e9c02bdb0402d57c45f78 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 23 Oct 2019 16:06:48 +0200 Subject: [PATCH 2/5] Update Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 671d5619e..5436d632b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,6 @@ RUN apk add --no-cache \ git \ socat \ glib \ - libstdc++ \ eudev \ eudev-libs From 05d7eff09a2eaf8c2e76419c82dd9ec80130c13c Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 24 Oct 2019 18:26:47 +0200 Subject: [PATCH 3/5] Fix secrets containing unsupported types (#1345) * Fix secrets containing unsupported types * Black * Cleanup --- hassio/secrets.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hassio/secrets.py b/hassio/secrets.py index 9bc0b55cc..e0fed4cdf 100644 --- a/hassio/secrets.py +++ b/hassio/secrets.py @@ -2,18 +2,15 @@ from datetime import timedelta import logging from pathlib import Path -from typing import Dict +from typing import Dict, Union from ruamel.yaml import YAML, YAMLError -import voluptuous as vol from .coresys import CoreSys, CoreSysAttributes from .utils import AsyncThrottle _LOGGER: logging.Logger = logging.getLogger(__name__) -SECRETS_SCHEMA = vol.Schema({str: vol.Any(str, int, None, float)}) - class SecretsManager(CoreSysAttributes): """Manage Home Assistant secrets.""" @@ -21,14 +18,14 @@ class SecretsManager(CoreSysAttributes): def __init__(self, coresys: CoreSys): """Initialize secret manager.""" self.coresys: CoreSys = coresys - self.secrets: Dict[str, str] = {} + self.secrets: Dict[str, Union[bool, float, int, str]] = {} @property def path_secrets(self) -> Path: """Return path to secret file.""" return Path(self.sys_config.path_homeassistant, "secrets.yaml") - def get(self, secret: str) -> str: + def get(self, secret: str) -> Union[bool, float, int, str]: """Get secret from store.""" _LOGGER.info("Request secret %s", secret) return self.secrets.get(secret) @@ -55,10 +52,12 @@ class SecretsManager(CoreSysAttributes): yaml = YAML() data = await self.sys_run_in_executor(yaml.load, self.path_secrets) or {} - self.secrets = SECRETS_SCHEMA(data) + # Filter to only get supported values + self.secrets = { + k: v for k, v in data.items() if isinstance(v, (bool, float, int, str)) + } + except YAMLError as err: _LOGGER.error("Can't process Home Assistant secrets: %s", err) - except vol.Invalid: - _LOGGER.warning("Home Assistant secrets have a invalid format") else: _LOGGER.debug("Reload Home Assistant secrets: %s", len(self.secrets)) From 71a162a87168d5fd01d39b912d753cce4ac79180 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 25 Oct 2019 11:44:03 +0200 Subject: [PATCH 4/5] Gracefully allow loading duplicate keys in secrets (#1347) --- hassio/secrets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hassio/secrets.py b/hassio/secrets.py index e0fed4cdf..642988cd8 100644 --- a/hassio/secrets.py +++ b/hassio/secrets.py @@ -50,6 +50,7 @@ class SecretsManager(CoreSysAttributes): # Read secrets try: yaml = YAML() + yaml.allow_duplicate_keys = True data = await self.sys_run_in_executor(yaml.load, self.path_secrets) or {} # Filter to only get supported values From 39a62864de7cffd83061701d7368e392f8fb2873 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2019 16:46:45 +0200 Subject: [PATCH 5/5] Bump pytest from 5.2.1 to 5.2.2 (#1348) Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.2.1 to 5.2.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/5.2.1...5.2.2) Signed-off-by: dependabot-preview[bot] --- requirements_tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_tests.txt b/requirements_tests.txt index beffc951d..4cf87e285 100644 --- a/requirements_tests.txt +++ b/requirements_tests.txt @@ -1,5 +1,5 @@ flake8==3.7.8 pylint==2.4.3 -pytest==5.2.1 +pytest==5.2.2 pytest-timeout==1.3.3 pytest-aiohttp==0.3.0