Skip to content

Commit

Permalink
fix: tell type checkers that the config options are strings (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer authored Apr 11, 2024
1 parent 22baa6f commit 8ab0802
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import logging
import secrets
import typing

from charms.tls_certificates_interface.v3.tls_certificates import (
CertificateAvailableEvent,
Expand Down Expand Up @@ -148,7 +149,7 @@ def _get_unit_common_name(self) -> str:
If `common_name` config option is set, it will be used as a common name.
Otherwise, the common name will be generated based on the application name and unit number.
"""
config_common_name = self.model.config.get("common_name")
config_common_name = typing.cast(str, self.model.config.get("common_name"))
if config_common_name:
return config_common_name
return f"{self.app.name}-{self._get_unit_number()}.{self.model.name}"
Expand Down

0 comments on commit 8ab0802

Please sign in to comment.