Skip to content

Commit 635d5e5

Browse files
committed
Fix union type
1 parent ca1c710 commit 635d5e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

exegol/model/MetaImages.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MetaImages:
1212
def __init__(self, dockerhub_data) -> None:
1313
"""Create a MetaImage object to handle multi-arch docker registry images in a single point"""
1414
# Raw data
15-
self.__dockerhub_images: List[Dict[str, Optional[str, int]]] = dockerhub_data.get('images', {})
15+
self.__dockerhub_images: List[Dict[str, Optional[Union[str, int]]]] = dockerhub_data.get('images', {})
1616
# Attributes
1717
self.name: str = dockerhub_data.get('name', '')
1818
self.multi_arch: bool = len(self.__dockerhub_images) > 1
@@ -58,7 +58,7 @@ def tagNameParsing(tag_name: str) -> str:
5858
return version
5959

6060
@staticmethod
61-
def parseArch(docker_image: Union[Dict[str, Any], Image]) -> str:
61+
def parseArch(docker_image: Union[Dict[str, Optional[Union[str, int]]], Image]) -> str:
6262
"""Parse and format arch in dockerhub style from registry dict struct.
6363
Return arch in format 'arch/variant'."""
6464
arch_key = "architecture"
@@ -68,7 +68,7 @@ def parseArch(docker_image: Union[Dict[str, Any], Image]) -> str:
6868
docker_image = docker_image.attrs
6969
arch_key = "Architecture"
7070
variant_key = "Variant"
71-
arch = docker_image.get(arch_key, "amd64")
71+
arch = str(docker_image.get(arch_key, "amd64"))
7272
variant = docker_image.get(variant_key)
7373
if variant:
7474
arch += f"/{variant}"

0 commit comments

Comments
 (0)