mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-24 01:26:35 +00:00
Add some issues and suggestion (#2557)
This commit is contained in:
parent
100cfb57c5
commit
9c33897296
@ -15,7 +15,7 @@ from .exceptions import (
|
||||
SupervisorUpdateError,
|
||||
)
|
||||
from .homeassistant.core import LANDINGPAGE
|
||||
from .resolution.const import ContextType, IssueType, UnhealthyReason
|
||||
from .resolution.const import ContextType, IssueType, SuggestionType, UnhealthyReason
|
||||
|
||||
_LOGGER: logging.Logger = logging.getLogger(__name__)
|
||||
|
||||
@ -213,6 +213,14 @@ class Core(CoreSysAttributes):
|
||||
else:
|
||||
_LOGGER.info("Skiping start of Home Assistant")
|
||||
|
||||
# Core is not running
|
||||
if self.sys_homeassistant.core.error_state:
|
||||
self.sys_resolution.create_issue(
|
||||
IssueType.FATAL_ERROR,
|
||||
ContextType.CORE,
|
||||
suggestions=[SuggestionType.EXECUTE_REPAIR],
|
||||
)
|
||||
|
||||
# start addon mark as application
|
||||
await self.sys_addons.boot(AddonStartup.APPLICATION)
|
||||
|
||||
|
@ -27,8 +27,9 @@ from ..const import (
|
||||
SECURITY_PROFILE,
|
||||
)
|
||||
from ..coresys import CoreSys
|
||||
from ..exceptions import CoreDNSError, DockerError, HardwareNotFound
|
||||
from ..exceptions import CoreDNSError, DockerError, DockerNotFound, HardwareNotFound
|
||||
from ..hardware.const import PolicyGroup
|
||||
from ..resolution.const import ContextType, IssueType, SuggestionType
|
||||
from ..utils import process_lock
|
||||
from .interface import DockerInterface
|
||||
|
||||
@ -370,26 +371,35 @@ class DockerAddon(DockerInterface):
|
||||
self._stop()
|
||||
|
||||
# Create & Run container
|
||||
docker_container = self.sys_docker.run(
|
||||
self.image,
|
||||
tag=str(self.addon.version),
|
||||
name=self.name,
|
||||
hostname=self.addon.hostname,
|
||||
detach=True,
|
||||
init=self.addon.default_init,
|
||||
privileged=self.full_access,
|
||||
stdin_open=self.addon.with_stdin,
|
||||
network_mode=self.network_mode,
|
||||
pid_mode=self.pid_mode,
|
||||
ports=self.ports,
|
||||
extra_hosts=self.network_mapping,
|
||||
device_cgroup_rules=self.cgroups_rules,
|
||||
cap_add=self.addon.privileged,
|
||||
security_opt=self.security_opt,
|
||||
environment=self.environment,
|
||||
volumes=self.volumes,
|
||||
tmpfs=self.tmpfs,
|
||||
)
|
||||
try:
|
||||
docker_container = self.sys_docker.run(
|
||||
self.image,
|
||||
tag=str(self.addon.version),
|
||||
name=self.name,
|
||||
hostname=self.addon.hostname,
|
||||
detach=True,
|
||||
init=self.addon.default_init,
|
||||
privileged=self.full_access,
|
||||
stdin_open=self.addon.with_stdin,
|
||||
network_mode=self.network_mode,
|
||||
pid_mode=self.pid_mode,
|
||||
ports=self.ports,
|
||||
extra_hosts=self.network_mapping,
|
||||
device_cgroup_rules=self.cgroups_rules,
|
||||
cap_add=self.addon.privileged,
|
||||
security_opt=self.security_opt,
|
||||
environment=self.environment,
|
||||
volumes=self.volumes,
|
||||
tmpfs=self.tmpfs,
|
||||
)
|
||||
except DockerNotFound:
|
||||
self.sys_resolution.create_issue(
|
||||
IssueType.MISSING_IMAGE,
|
||||
ContextType.ADDON,
|
||||
reference=self.addon.slug,
|
||||
suggestion=[SuggestionType.EXECUTE_REPAIR],
|
||||
)
|
||||
raise
|
||||
|
||||
self._meta = docker_container.attrs
|
||||
_LOGGER.info(
|
||||
|
Loading…
x
Reference in New Issue
Block a user