Tag installation type & more infos (#1887)

* Tag installation type & more infos

* fix black

* Make sure dbus is available for reports

* HassOS warning -> info

* Fix installation type name

* fix correct ADR

* change name

* make message more friendly
This commit is contained in:
Pascal Vizeli 2020-08-11 10:52:33 +02:00 committed by GitHub
parent f27a426879
commit a51b80f456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View File

@ -301,6 +301,8 @@ def setup_diagnostics(coresys: CoreSys) -> None:
"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,
@ -308,6 +310,10 @@ def setup_diagnostics(coresys: CoreSys) -> None:
"cli": coresys.plugins.cli.version,
},
)
scope.set_tag(
"installation_type",
f"{'os' if coresys.hassos.available else 'supervised'}",
)
return event

View File

@ -32,6 +32,7 @@ FILE_HASSIO_MULTICAST = Path(SUPERVISOR_DATA, "multicast.json")
MACHINE_ID = Path("/etc/machine-id")
SOCKET_DOCKER = Path("/run/docker.sock")
SOCKET_DBUS = Path("/run/dbus/system_bus_socket")
DOCKER_NETWORK = "hassio"
DOCKER_NETWORK_MASK = ip_network("172.30.32.0/23")

View File

@ -5,7 +5,7 @@ import logging
import async_timeout
from .const import AddonStartup, CoreStates
from .const import SOCKET_DBUS, AddonStartup, CoreStates
from .coresys import CoreSys, CoreSysAttributes
from .exceptions import HassioError, HomeAssistantError, SupervisorUpdateError
@ -47,6 +47,13 @@ class Core(CoreSysAttributes):
self.sys_docker.info.check_requirements()
# Dbus available
if not SOCKET_DBUS.exists():
self.healthy = False
_LOGGER.critical(
"DBus is required for Home Assistant. This system is not supported!"
)
# Check if system is healthy
if not self.healthy:
_LOGGER.critical(

View File

@ -97,7 +97,7 @@ class HassOS(CoreSysAttributes):
if cpe.get_product()[0] != "hassos":
raise NotImplementedError()
except NotImplementedError:
_LOGGER.warning("No Home Assistant Operating System found!")
_LOGGER.info("No Home Assistant Operating System found")
return
else:
self._available = True