From 85546128e71a6f5bb8f0565dd9f8ac4c9e313276 Mon Sep 17 00:00:00 2001 From: Tony Meyer Date: Thu, 11 Apr 2024 17:24:49 +1200 Subject: [PATCH] Tell type checkers that the config options are strings. --- src/charm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charm.py b/src/charm.py index 8f74370..938ee71 100755 --- a/src/charm.py +++ b/src/charm.py @@ -125,7 +125,7 @@ def _get_external_hostname(self) -> str: Returns: The assigned hostname. """ - hostname = self.config["external_hostname"] + hostname = typing.cast(str, self.config["external_hostname"]) if hostname == "": hostname = self.app.name return hostname @@ -459,7 +459,7 @@ def _make_pod_env(self) -> Union[dict, bool, set, str]: Returns: A dictionary used for envConfig in podspec. """ - env = self.model.config["environment"] + env = typing.cast(str, self.model.config["environment"]) if not env: return {}