Skip to content

Commit

Permalink
Add type hints.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Mar 27, 2024
1 parent 4b7a783 commit 259a974
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scenario/consistency_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from collections import Counter
from collections.abc import Sequence
from numbers import Number
from typing import TYPE_CHECKING, Iterable, List, NamedTuple, Tuple
from typing import TYPE_CHECKING, Iterable, List, NamedTuple, Tuple, Union

from scenario.runtime import InconsistentScenarioError
from scenario.runtime import logger as scenario_logger
Expand Down Expand Up @@ -327,10 +327,10 @@ def check_storages_consistency(
return Results(errors, [])


def _is_secret_identifier(value: str):
def _is_secret_identifier(value: Union[str, int, float, bool]):
"""Return true iff the value is in the form `secret:{secret id}`."""
# cf. https://github.com/juju/juju/blob/13eb9df3df16a84fd471af8a3c95ddbd04389b71/core/secrets/secret.go#L48
return re.match(r"secret:[0-9a-z]{20}$", secret_id)
return re.match(r"secret:[0-9a-z]{20}$", str(value))


def check_config_consistency(
Expand Down

0 comments on commit 259a974

Please sign in to comment.