From f8afe0ea0d9ea4ae8cac079b3270c1360877137e Mon Sep 17 00:00:00 2001 From: Andrea Ieri Date: Tue, 10 Dec 2024 18:42:23 -0800 Subject: [PATCH] Store tools as a set of strings (#365) As noted the get_stored_tools(), StoredState cannot store arbitrary objects; this commit applies the same logic to _on_redetect_hardware() Fixes: #364 --- src/charm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index ec8a8534..68bdb680 100755 --- a/src/charm.py +++ b/src/charm.py @@ -115,7 +115,7 @@ def _on_redetect_hardware(self, event: ops.ActionEvent) -> None: if event.params["apply"] and hw_change_detected: # Update the value in local Store - self._stored.stored_tools = available_tools + self._stored.stored_tools = {tool.value for tool in available_tools} event.log(f"Run install hook with enable tools: {sorted_available_tools}") self._on_install_or_upgrade(event=event)