Fix attribute in sentry data_filter (#1920)

This commit is contained in:
Joakim Sørensen 2020-08-14 19:29:10 +02:00 committed by GitHub
parent fc83cb9559
commit b51f9586c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ def filter_data(coresys: CoreSys, event: dict, hint: dict) -> dict:
return None
# Ignore issue if system is not supported or diagnostics is disabled
if not coresys.config.diagnostics or not coresys.supported or dev_env:
if not coresys.config.diagnostics or not coresys.core.supported or dev_env:
return None
# Not full startup - missing information

View File

@ -17,21 +17,21 @@ def test_ignored_exception(coresys):
def test_diagnostics_disabled(coresys):
"""Test if diagnostics is disabled."""
coresys.config.diagnostics = False
coresys.supported = True
coresys.core.supported = True
assert filter_data(coresys, SAMPLE_EVENT, {}) is None
def test_not_supported(coresys):
"""Test if not supported."""
coresys.config.diagnostics = True
coresys.supported = False
coresys.core.supported = False
assert filter_data(coresys, SAMPLE_EVENT, {}) is None
def test_is_dev(coresys):
"""Test if dev."""
coresys.config.diagnostics = True
coresys.supported = True
coresys.core.supported = True
with patch("os.environ", return_value=[("ENV_SUPERVISOR_DEV", "1")]):
assert filter_data(coresys, SAMPLE_EVENT, {}) is None
@ -39,7 +39,7 @@ def test_is_dev(coresys):
def test_not_started(coresys):
"""Test if supervisor not fully started."""
coresys.config.diagnostics = True
coresys.supported = True
coresys.core.supported = True
coresys.core.state = CoreStates.INITIALIZE
assert filter_data(coresys, SAMPLE_EVENT, {}) == SAMPLE_EVENT