mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-24 09:36:31 +00:00
commit
dd3ba93308
@ -387,7 +387,7 @@ def _single_validate(coresys: CoreSys, typ: str, value: Any, key: str):
|
||||
# Lookup secret
|
||||
if str(value).startswith("!secret "):
|
||||
secret: str = value.partition(" ")[2]
|
||||
value = coresys.secrets.get(secret)
|
||||
value = coresys.homeassistant.secrets.get(secret)
|
||||
if value is None:
|
||||
raise vol.Invalid(f"Unknown secret {secret}") from None
|
||||
|
||||
|
@ -3,7 +3,7 @@ from enum import Enum
|
||||
from ipaddress import ip_network
|
||||
from pathlib import Path
|
||||
|
||||
SUPERVISOR_VERSION = "237"
|
||||
SUPERVISOR_VERSION = "238"
|
||||
|
||||
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"
|
||||
URL_HASSIO_APPARMOR = "https://version.home-assistant.io/apparmor.txt"
|
||||
|
@ -45,6 +45,10 @@ class Core(CoreSysAttributes):
|
||||
_LOGGER.error(
|
||||
"Detected Docker running inside LXC. Running Home Assistant with the Supervisor on LXC is not supported!"
|
||||
)
|
||||
elif not self.sys_supervisor.instance.privileged:
|
||||
self.supported = False
|
||||
self.healthy = False
|
||||
_LOGGER.error("Supervisor does not run in Privileged mode.")
|
||||
|
||||
if self.sys_docker.info.check_requirements():
|
||||
self.supported = False
|
||||
@ -145,7 +149,7 @@ class Core(CoreSysAttributes):
|
||||
# Check if image names from denylist exist
|
||||
try:
|
||||
if await self.sys_run_in_executor(self.sys_docker.check_denylist_images):
|
||||
self.coresys.supported = False
|
||||
self.supported = False
|
||||
self.healthy = False
|
||||
except DockerAPIError:
|
||||
self.healthy = False
|
||||
|
@ -34,6 +34,8 @@ def filter_data(coresys: CoreSys, event: dict, hint: dict) -> dict:
|
||||
if not coresys.config.diagnostics or not coresys.core.supported or dev_env:
|
||||
return None
|
||||
|
||||
event.setdefault("extra", {}).update({"os.environ": dict(os.environ)})
|
||||
|
||||
# Not full startup - missing information
|
||||
if coresys.core.state in (CoreState.INITIALIZE, CoreState.SETUP):
|
||||
return event
|
||||
|
@ -41,12 +41,6 @@ class Supervisor(CoreSysAttributes):
|
||||
with suppress(DockerAPIError):
|
||||
await self.instance.cleanup()
|
||||
|
||||
# Check privileged mode
|
||||
if not self.instance.privileged:
|
||||
_LOGGER.error(
|
||||
"Supervisor does not run in Privileged mode. Hassio runs with limited functionality!"
|
||||
)
|
||||
|
||||
@property
|
||||
def ip_address(self) -> IPv4Address:
|
||||
"""Return IP of Supervisor instance."""
|
||||
|
@ -153,8 +153,7 @@ class DBus:
|
||||
try:
|
||||
return json.loads(json_raw)
|
||||
except json.JSONDecodeError as err:
|
||||
_LOGGER.error("Can't parse '%s': %s", json_raw, err)
|
||||
_LOGGER.debug("GVariant data: '%s'", raw)
|
||||
_LOGGER.critical("Can't parse '%s': '%s' - %s", json_raw, raw, err)
|
||||
raise DBusParseError() from err
|
||||
|
||||
@staticmethod
|
||||
|
@ -1,11 +1,21 @@
|
||||
"""Test sentry data filter."""
|
||||
import os
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from supervisor.const import SUPERVISOR_VERSION, CoreState
|
||||
from supervisor.exceptions import AddonConfigurationError
|
||||
from supervisor.misc.filter import filter_data
|
||||
|
||||
SAMPLE_EVENT = {"sample": "event"}
|
||||
SAMPLE_EVENT = {"sample": "event", "extra": {"Test": "123"}}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def sys_env(autouse=True):
|
||||
"""Fixture to inject hassio env."""
|
||||
with patch.dict(os.environ, {"Test": "123"}):
|
||||
yield
|
||||
|
||||
|
||||
def test_ignored_exception(coresys):
|
||||
|
Loading…
x
Reference in New Issue
Block a user