From c79b0a577234d21a3e4a875b1df2af320a264192 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Fri, 11 Oct 2024 13:14:03 -0400 Subject: [PATCH] chore: replace ops.main.main() with ops.main (#397) Signed-off-by: Guillaume Belanger --- src/charm.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/charm.py b/src/charm.py index 4b50db05..aeaaf904 100755 --- a/src/charm.py +++ b/src/charm.py @@ -30,10 +30,17 @@ from lightkube.core.client import Client from lightkube.models.meta_v1 import ObjectMeta from lightkube.resources.core_v1 import Node, Pod -from ops import ActiveStatus, BlockedStatus, Container, ModelError, RemoveEvent, WaitingStatus +from ops import ( + ActiveStatus, + BlockedStatus, + Container, + ModelError, + RemoveEvent, + WaitingStatus, + main, +) from ops.charm import CharmBase, CollectStatusEvent from ops.framework import EventBase -from ops.main import main from ops.pebble import ChangeError, ConnectionError, ExecError, Layer, PathError from charm_config import CharmConfig, CharmConfigInvalidError, CNIType, UpfMode @@ -497,7 +504,7 @@ def _on_collect_unit_status(self, event: CollectStatusEvent): # noqa C901 if not path_exists( container=self._pfcp_agent_container, path=PFCP_AGENT_CONTAINER_CONFIG_PATH, - ): + ): event.add_status( WaitingStatus("Waiting for storage to be attached for pfcp-agent container") )