Skip to content

Commit

Permalink
update_manager: improve Klipper detection
Browse files Browse the repository at this point in the history
If the Klipper installation is not updatable (ie not a git repo)
abort reinstantion of the deployer.

Signed-off-by:  Eric Callahan <[email protected]>
  • Loading branch information
Arksine committed Nov 2, 2023
1 parent e03dbe3 commit 4001137
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions moonraker/components/update_manager/update_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4001137

Please sign in to comment.