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 <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-11-02 06:19:14 -04:00
parent e03dbe3251
commit 40011370a3
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 5 additions and 4 deletions

View File

@ -193,17 +193,18 @@ class UpdateManager:
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)