From 40011370a34582a3db8eaa0e6252b4be0243c2d4 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Thu, 2 Nov 2023 06:19:14 -0400 Subject: [PATCH] update_manager: improve Klipper detection If the Klipper installation is not updatable (ie not a git repo) abort reinstantion of the deployer. Signed-off-by: Eric Callahan --- moonraker/components/update_manager/update_manager.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/moonraker/components/update_manager/update_manager.py b/moonraker/components/update_manager/update_manager.py index 2833b7d5f..9786f039d 100644 --- a/moonraker/components/update_manager/update_manager.py +++ b/moonraker/components/update_manager/update_manager.py @@ -193,17 +193,18 @@ def _set_klipper_repo(self) -> None: kpath: str = kinfo['klipper_path'] executable: str = kinfo['python_path'] kupdater = self.updaters.get('klipper') + app_type = get_app_type(kpath) if ( - isinstance(kupdater, AppDeploy) and - kupdater.check_same_paths(kpath, executable) + (isinstance(kupdater, AppDeploy) and + kupdater.check_same_paths(kpath, executable)) or + (app_type == AppType.NONE and type(kupdater) is BaseDeploy) ): - # Current Klipper Updater is valid + # Current Klipper Updater is valid or unnecessary return # Update paths in the database db: DBComp = self.server.lookup_component('database') db.insert_item("moonraker", "update_manager.klipper_path", kpath) db.insert_item("moonraker", "update_manager.klipper_exec", executable) - app_type = get_app_type(kpath) kcfg = self.app_config["klipper"] kcfg.set_option("path", kpath) kcfg.set_option("env", executable)