mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 20:26:29 +00:00
Fix sentry resoluton messages (#2295)
This commit is contained in:
parent
84294f286f
commit
056926242f
@ -74,8 +74,10 @@ def filter_data(coresys: CoreSys, event: dict, hint: dict) -> dict:
|
||||
"os": coresys.hassos.version,
|
||||
"supervisor": coresys.supervisor.version,
|
||||
},
|
||||
"issues": [attr.asdict(issue) for issue in coresys.resolution.issues],
|
||||
"unhealthy": coresys.resolution.unhealthy,
|
||||
"resolution": {
|
||||
"issues": [attr.asdict(issue) for issue in coresys.resolution.issues],
|
||||
"unhealthy": coresys.resolution.unhealthy,
|
||||
},
|
||||
}
|
||||
)
|
||||
event.setdefault("tags", []).extend(
|
||||
|
@ -119,9 +119,9 @@ def test_issues_on_report(coresys):
|
||||
with patch("shutil.disk_usage", return_value=(42, 42, 2 * (1024.0 ** 3))):
|
||||
event = filter_data(coresys, SAMPLE_EVENT, {})
|
||||
|
||||
assert "issues" in event["contexts"]
|
||||
assert event["contexts"]["issues"][0]["type"] == IssueType.FATAL_ERROR
|
||||
assert event["contexts"]["issues"][0]["context"] == ContextType.SYSTEM
|
||||
assert "issues" in event["contexts"]["resolution"]
|
||||
assert event["contexts"]["resolution"]["issues"][0]["type"] == IssueType.FATAL_ERROR
|
||||
assert event["contexts"]["resolution"]["issues"][0]["context"] == ContextType.SYSTEM
|
||||
|
||||
|
||||
def test_unhealthy_on_report(coresys):
|
||||
@ -134,5 +134,5 @@ def test_unhealthy_on_report(coresys):
|
||||
with patch("shutil.disk_usage", return_value=(42, 42, 2 * (1024.0 ** 3))):
|
||||
event = filter_data(coresys, SAMPLE_EVENT, {})
|
||||
|
||||
assert "issues" in event["contexts"]
|
||||
assert event["contexts"]["unhealthy"][-1] == UnhealthyReason.DOCKER
|
||||
assert "issues" in event["contexts"]["resolution"]
|
||||
assert event["contexts"]["resolution"]["unhealthy"][-1] == UnhealthyReason.DOCKER
|
||||
|
Loading…
x
Reference in New Issue
Block a user