diff --git a/src/ansible_navigator/actions/images.py b/src/ansible_navigator/actions/images.py index 18f22f5ab..5aedebbe3 100644 --- a/src/ansible_navigator/actions/images.py +++ b/src/ansible_navigator/actions/images.py @@ -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 diff --git a/src/ansible_navigator/utils/functions.py b/src/ansible_navigator/utils/functions.py index bfa1ec567..9c34d6351 100644 --- a/src/ansible_navigator/utils/functions.py +++ b/src/ansible_navigator/utils/functions.py @@ -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 @@ -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