Skip to content

Commit

Permalink
Tell type checkers that the config options are strings. (#141)
Browse files Browse the repository at this point in the history
Co-authored-by: Phan Trung Thanh <[email protected]>
Co-authored-by: Yanks Yoon <[email protected]>
  • Loading branch information
3 people authored May 3, 2024
1 parent ddb0541 commit 08a48ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def from_charm(cls, charm: ops.CharmBase) -> "State":
CharmIllegalNumUnitsError: if more than 1 unit of Jenkins charm is deployed.
"""
try:
time_range_str = charm.config.get("restart-time-range")
time_range_str = typing.cast(str, charm.config.get("restart-time-range"))
if time_range_str:
restart_time_range = Range.from_str(time_range_str)
else:
Expand Down Expand Up @@ -301,7 +301,7 @@ def from_charm(cls, charm: ops.CharmBase) -> "State":
logger.error("Invalid juju model proxy configuration, %s", exc)
raise CharmConfigInvalidError("Invalid model proxy configuration.") from exc

plugins_str = charm.config.get("allowed-plugins")
plugins_str = typing.cast(str, charm.config.get("allowed-plugins"))
plugins = (plugin.strip() for plugin in plugins_str.split(",")) if plugins_str else None

if charm.app.planned_units() > 1:
Expand Down

0 comments on commit 08a48ce

Please sign in to comment.