Skip to content

Commit

Permalink
More types
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Feb 29, 2024
1 parent 575b345 commit c22e0c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ansible_navigator/actions/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def _collect_image_list(self) -> None:

try:
legacy_check = details["config"]["working_dir"] == "/runner"
except KeyError:
except (KeyError, TypeError):
legacy_check = False

# podman has a root label
Expand Down
7 changes: 5 additions & 2 deletions src/ansible_navigator/utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def now_iso(time_zone: str) -> str:
PASCAL_REGEX = re.compile("((?<=[a-z0-9])[A-Z]|(?!^)[A-Z](?=[a-z]))")


def pascal_to_snake(obj) -> list[Any] | dict[Any, Any]:
def pascal_to_snake(obj: object) -> object:
"""Convert a pascal cased object into a snake cased object recursively.
:param obj: Pascal cased object
Expand Down Expand Up @@ -529,4 +529,7 @@ def unescape_moustaches(obj: Any) -> Mapping[Any, Any]:
:returns: The obj with replacements made
"""
replacements = (("U+007B", "{"), ("U+007D", "}"))
return dispatch(obj, replacements)
result = dispatch(obj, replacements)
if not isinstance(result, dict):
raise RuntimeError
return result

0 comments on commit c22e0c3

Please sign in to comment.