Mark system without using NetworkManager as unsupported (#2114)

* Mark system without using NetworkManager as unsupported

* Use feature style

* fix code
This commit is contained in:
Pascal Vizeli 2020-10-10 18:30:34 +02:00 committed by GitHub
parent cb751e0397
commit 4c525de5e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@ from .const import (
SUPERVISED_SUPPORTED_OS,
AddonStartup,
CoreState,
HostFeature,
)
from .coresys import CoreSys, CoreSysAttributes
from .exceptions import (
@ -161,16 +162,21 @@ class Core(CoreSysAttributes):
self.sys_host.info.operating_system,
)
# Check all DBUS connectivity
if not self.sys_dbus.hostname.is_connected:
# Check Host features
if HostFeature.NETWORK not in self.sys_host.supported_features:
self.supported = False
_LOGGER.error("Hostname DBUS is not connected")
if not self.sys_dbus.network.is_connected:
_LOGGER.error("NetworkManager is not correct working")
if any(
feature not in self.sys_host.supported_features
for feature in (
HostFeature.HOSTNAME,
HostFeature.SERVICES,
HostFeature.SHUTDOWN,
HostFeature.REBOOT,
)
):
self.supported = False
_LOGGER.error("NetworkManager is not connected")
if not self.sys_dbus.systemd.is_connected:
self.supported = False
_LOGGER.error("Systemd DBUS is not connected")
_LOGGER.error("Systemd is not correct working")
# Check if image names from denylist exist
try: