diff --git a/exegol-resources b/exegol-resources index 63a30620..4c0dee13 160000 --- a/exegol-resources +++ b/exegol-resources @@ -1 +1 @@ -Subproject commit 63a306201c85662453622b66d7e3f69a9b1e2e7e +Subproject commit 4c0dee13ad16fa42947c1677dbd02a1f4456df90 diff --git a/exegol/config/ConstantConfig.py b/exegol/config/ConstantConfig.py index 39b8939f..0c7b194a 100644 --- a/exegol/config/ConstantConfig.py +++ b/exegol/config/ConstantConfig.py @@ -5,7 +5,7 @@ class ConstantConfig: """Constant parameters information""" # Exegol Version - version: str = "4.2.3" + version: str = "4.2.4" # Exegol documentation link documentation: str = "https://exegol.rtfd.io/" diff --git a/exegol/config/EnvInfo.py b/exegol/config/EnvInfo.py index 81a1d7a0..ff54b9fa 100644 --- a/exegol/config/EnvInfo.py +++ b/exegol/config/EnvInfo.py @@ -78,7 +78,7 @@ def initData(cls, docker_info): # Deduct a Windows Host from data cls.__is_docker_desktop = docker_os == "docker desktop" is_host_windows = cls.__is_docker_desktop and "microsoft" in docker_kernel - is_orbstack = "(containerized)" in docker_os and "orbstack" in docker_kernel + is_orbstack = (docker_os == "orbstack" or "(containerized)" in docker_os) and "orbstack" in docker_kernel if is_host_windows: # Check docker engine with Windows host if "wsl2" in docker_kernel: diff --git a/exegol/manager/UpdateManager.py b/exegol/manager/UpdateManager.py index dd97688b..f802be36 100644 --- a/exegol/manager/UpdateManager.py +++ b/exegol/manager/UpdateManager.py @@ -202,7 +202,8 @@ def __checkUpdate(cls) -> bool: module = ExegolModules().getWrapperGit(fast_load=True) if module.isAvailable: isUpToDate = module.isUpToDate() - remote_version = str(module.get_latest_commit())[:8] + last_commit = module.get_latest_commit() + remote_version = "?" if last_commit is None else str(last_commit)[:8] current_version = str(module.get_current_commit())[:8] else: # If Exegol have not been installed from git clone. Auto-check update in this case is only available from mates release diff --git a/exegol/model/ExegolContainer.py b/exegol/model/ExegolContainer.py index 30d26f59..d2cfccf6 100644 --- a/exegol/model/ExegolContainer.py +++ b/exegol/model/ExegolContainer.py @@ -257,6 +257,10 @@ def __applyXhostACL(self): """ if self.config.isGUIEnable() and not self.__xhost_applied and not EnvInfo.isWindowsHost(): self.__xhost_applied = True # Can be applied only once per execution + if shutil.which("xhost") is None: + logger.error("The [green]xhost[/green] command is not available on your [bold]host[/bold]. " + "Exegol was unable to allow your container to access your graphical environment (or you don't have one).") + return if EnvInfo.isMacHost(): logger.debug(f"Adding xhost ACL to localhost") diff --git a/exegol/utils/DockerUtils.py b/exegol/utils/DockerUtils.py index 2c044085..a65f3fec 100644 --- a/exegol/utils/DockerUtils.py +++ b/exegol/utils/DockerUtils.py @@ -349,7 +349,9 @@ def __findLocalRecoveryImages(cls, include_untag: bool = False) -> List[Image]: id_list = set() for img in recovery_images: # Docker can keep track of 2 images maximum with RepoTag or RepoDigests, after it's hard to track origin without labels, so this recovery option is "best effort" - if len(img.attrs.get('RepoTags', [1])) > 0 or (not include_untag and len(img.attrs.get('RepoDigests', [1])) > 0) or img.id in id_list: + repo_tags = img.attrs.get('RepoTags') + repo_digest = img.attrs.get('RepoDigests') + if repo_tags is not None and len(repo_tags) > 0 or (not include_untag and repo_digest is not None and len(repo_digest) > 0) or img.id in id_list: # Skip image from other repo and image already found continue if img.labels.get('org.exegol.app', '') == "Exegol": diff --git a/exegol/utils/GitUtils.py b/exegol/utils/GitUtils.py index 34e0b0a0..5a3af577 100644 --- a/exegol/utils/GitUtils.py +++ b/exegol/utils/GitUtils.py @@ -126,7 +126,7 @@ def clone(self, repo_url: str, optimize_disk_space: bool = True) -> bool: progress.add_task(f"[bold red]Cloning {self.getName()} git repository", start=True) self.__gitRepo = Repo.clone_from(repo_url, str(self.__repo_path), multi_options=custom_options, progress=clone_update_progress) progress.remove_task(progress.tasks[0].id) - logger.success(f"The {self.getName()} git repository have been successfully clone!") + logger.success(f"The Git repository {self.getName()} was successfully cloned!") except GitCommandError as e: # GitPython user \n only error = GitUtils.formatStderr(e.stderr) @@ -217,6 +217,7 @@ def isUpToDate(self, branch: Optional[str] = None) -> bool: logger.debug("NEW TAG flag detected") remote_commit = self.get_latest_commit() + assert remote_commit is not None # Check if remote_commit is an ancestor of the last local commit (check if there is local commit ahead) return self.__gitRepo.is_ancestor(remote_commit, current_commit) @@ -253,7 +254,9 @@ def get_latest_commit(self): assert self.isAvailable assert not ParametersManager().offline_mode if self.__fetchBranchInfo is None: - self.__fetch_update() + if not self.__fetch_update(): + logger.debug("The latest commit cannot be retrieved.") + return None assert self.__fetchBranchInfo is not None return self.__fetchBranchInfo.commit diff --git a/requirements.txt b/requirements.txt index c456d12a..bc41ff5f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -docker~=6.1.2 -requests>=2.30.0 -rich~=13.3.0 +docker~=6.1.3 +requests>=2.31.0 +rich~=13.4.2 GitPython~=3.1.29 PyYAML>=6.0 -argcomplete~=3.0.8 \ No newline at end of file +argcomplete~=3.1.1 \ No newline at end of file diff --git a/setup.py b/setup.py index 79f5ccac..2ec07207 100644 --- a/setup.py +++ b/setup.py @@ -49,12 +49,12 @@ "Operating System :: OS Independent", ], install_requires=[ - 'docker~=6.1.2', - 'requests>=2.30.0', - 'rich~=13.3.0', + 'docker~=6.1.3', + 'requests>=2.31.0', + 'rich~=13.4.2', 'PyYAML', 'GitPython', - 'argcomplete~=3.0.8' + 'argcomplete~=3.1.1' ], packages=find_packages(exclude=["tests"]), include_package_data=True, diff --git a/tests/test_exegol.py b/tests/test_exegol.py index 5cadc990..b98740f9 100644 --- a/tests/test_exegol.py +++ b/tests/test_exegol.py @@ -2,4 +2,4 @@ def test_version(): - assert __version__ == '4.2.3' + assert __version__ == '4.2.4'