Merge "update container status once service is ready" into main

This commit is contained in:
Zuul 2022-11-17 10:02:02 +00:00 committed by Gerrit Code Review
commit b45eb8aac4
2 changed files with 8 additions and 0 deletions

View File

@ -166,6 +166,7 @@ class PebbleHandler(ops.charm.Object):
self.setup_dirs()
self.write_config(context)
self._state.service_ready = True
self.status.set(ActiveStatus(""))
def default_container_configs(
self,
@ -315,6 +316,7 @@ class ServicePebbleHandler(PebbleHandler):
else:
self.start_service(restart=False)
self._state.service_ready = True
self.status.set(ActiveStatus(""))
def start_service(self, restart: bool = True) -> None:
"""Check and start services in container.
@ -447,6 +449,7 @@ class WSGIPebbleHandler(PebbleHandler):
else:
self.start_wsgi(restart=False)
self._state.service_ready = True
self.status.set(ActiveStatus(""))
@property
def wsgi_conf(self) -> str:

View File

@ -18,6 +18,10 @@ from typing import (
List,
)
from ops.model import (
ActiveStatus,
)
from .. import container_handlers as sunbeam_chandlers
from .. import core as sunbeam_core
@ -46,6 +50,7 @@ class OVNPebbleHandler(sunbeam_chandlers.ServicePebbleHandler):
self.setup_dirs()
self.write_config(context)
self._state.service_ready = True
self.status.set(ActiveStatus(""))
@property
def service_description(self) -> str: