mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 07:06:30 +00:00
Sentry send env infos (#1992)
This commit is contained in:
parent
58b88a6919
commit
a9a2c35f06
@ -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
|
||||
|
@ -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