From a156f81760c273ea3cd2b733a4813e9ce9f1c3a3 Mon Sep 17 00:00:00 2001 From: Tony Meyer Date: Tue, 6 Aug 2024 19:21:12 +1200 Subject: [PATCH] Add comment as recommended in review. --- scenario/context.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scenario/context.py b/scenario/context.py index bd6628bc..998274fd 100644 --- a/scenario/context.py +++ b/scenario/context.py @@ -563,6 +563,10 @@ def run(self, event: "_Event", state: "State") -> "State": charm will invoke when handling the Event. """ if event.action: + # Create an ActionOutput object now so that there is somewhere to + # store the logs and results while the charm is processing the + # action handler(s). This is not accessible until run() finishes and + # the handlers have finished. self.action_output = ActionOutput() with self._run(event=event, state=state) as ops: ops.emit()