fix sentry

This commit is contained in:
Pascal Vizeli 2020-08-11 17:42:55 +00:00
parent e70c9d8a30
commit 1df35a6fe1

View File

@ -292,29 +292,24 @@ def setup_diagnostics(coresys: CoreSys) -> None:
return event
# Update information
with sentry_sdk.configure_scope() as scope:
scope.set_context(
"supervisor",
{
"machine": coresys.machine,
"arch": coresys.arch.default,
"docker": coresys.docker.info.version,
"channel": coresys.updater.channel,
"supervisor": coresys.supervisor.version,
"os": coresys.hassos.version,
"host": coresys.host.info.operating_system,
"kernel": coresys.host.info.kernel,
"core": coresys.homeassistant.version,
"audio": coresys.plugins.audio.version,
"dns": coresys.plugins.dns.version,
"multicast": coresys.plugins.multicast.version,
"cli": coresys.plugins.cli.version,
},
)
scope.set_tag(
"installation_type",
f"{'os' if coresys.hassos.available else 'supervised'}",
)
event["contexts"]["supervisor"] = {
"machine": coresys.machine,
"arch": coresys.arch.default,
"docker": coresys.docker.info.version,
"channel": coresys.updater.channel,
"supervisor": coresys.supervisor.version,
"os": coresys.hassos.version,
"host": coresys.host.info.operating_system,
"kernel": coresys.host.info.kernel,
"core": coresys.homeassistant.version,
"audio": coresys.plugins.audio.version,
"dns": coresys.plugins.dns.version,
"multicast": coresys.plugins.multicast.version,
"cli": coresys.plugins.cli.version,
}
event["tags"][
"installation_type"
] = f"{'os' if coresys.hassos.available else 'supervised'}"
return event