Skip to content

Commit 2334750

Browse files
committed
Fix image result type
1 parent 371053f commit 2334750

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ The license is automatically terminated in case of violation of the stated terms
109109

110110
## 10. Governing law and jurisdiction
111111

112-
This license is governed by French law. Any dispute relating to its interpretation or application shall be submitted to the exclusive jurisdiction of the courts of Paris.
112+
This license is governed by French law. Any dispute relating to its interpretation or application shall be submitted to the exclusive jurisdiction of the courts of Paris.

exegol/manager/UpdateManager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ async def updateImage(cls, tag: Optional[str] = None, install_mode: bool = False
6868
if selected_image.isVersionSpecific():
6969
# Install latest tag if not already installed
7070
try:
71-
await DockerUtils().getOfficialImageFromList(selected_image.getName().split('-')[0])
71+
result = await DockerUtils().getOfficialImageFromList(selected_image.getName().split('-')[0])
72+
if result is None or not result.isInstall():
73+
raise ObjectNotFound
7274
except ObjectNotFound:
7375
DockerUtils().createLocalLastestImageTag(selected_image)
7476
elif selected_image.hasVersionTag():

exegol/utils/DockerUtils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,14 @@ async def listImages(self, include_version_tag: bool = False, include_locked: bo
465465
result = [img for img in result if not img.isVersionSpecific() or img.isInstall()]
466466
return result
467467

468-
async def getOfficialImageFromList(self, tag: str) -> Union[ExegolImage, str]:
468+
async def getOfficialImageFromList(self, tag: str) -> ExegolImage:
469469
"""Get an ExegolImage from tag name."""
470470
# Fetch every official images available
471471
images = await self.listImages(include_version_tag=True, include_locked=True)
472472
match: Optional[ExegolImage] = None
473473
# image tag without version
474474
tag_only = tag.split('-')[0] if '-' in tag else None
475-
tag_only_match = None
475+
tag_only_match: Optional[ExegolImage] = None
476476
# Find a match
477477
for i in images:
478478
if i.getName() == tag:

0 commit comments

Comments
 (0)