From 269f18a22f1866ec295520ee2992d17a3c6317f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 19 Jun 2015 22:26:22 +0200 Subject: [PATCH] Software Update Fix: Only migrate config settings that are actually in the config --- .../plugins/softwareupdate/__init__.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py index 0d2c96af..4d91dd83 100644 --- a/src/octoprint/plugins/softwareupdate/__init__.py +++ b/src/octoprint/plugins/softwareupdate/__init__.py @@ -100,15 +100,18 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin, # even the stuff that shouldn't be persisted but always provided by the hook - let's # clean up + configured_checks = self._settings.get(["checks"], incl_defaults=False) + if configured_checks is None: + configured_checks = dict() + # take care of the octoprint entry - configured_checks = self._settings.get(["checks"], merged=True) - octoprint_check = dict(configured_checks["octoprint"]) - if "type" in octoprint_check and not octoprint_check["type"] == "github_commit": - deletables=["current"] - else: - deletables=[] - octoprint_check = self._clean_settings_check("octoprint", octoprint_check, self.get_settings_defaults()["checks"]["octoprint"], delete=deletables, save=False) - configured_checks["octoprint"] = octoprint_check + if "octoprint" in configured_checks: + octoprint_check = dict(configured_checks["octoprint"]) + if "type" in octoprint_check and not octoprint_check["type"] == "github_commit": + deletables=["current"] + else: + deletables=[] + octoprint_check = self._clean_settings_check("octoprint", configured_checks, self.get_settings_defaults()["checks"]["octoprint"], delete=deletables, save=False) # and the hooks update_check_hooks = self._plugin_manager.get_hooks("octoprint.plugin.softwareupdate.check_config")