diff options
Diffstat (limited to 'lorry-controller')
-rwxr-xr-x | lorry-controller | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lorry-controller b/lorry-controller index b1f4d86..ba793ad 100755 --- a/lorry-controller +++ b/lorry-controller @@ -91,7 +91,11 @@ class LorryController(cliapp.Application): for dead_lorry in prev_lorries - cur_lorries: logging.info("Dead lorry: %s" % dead_lorry) conf_uuid = mgr.lorry_state[dead_lorry]['conf'] - should_delete = self.conf.configs[conf_uuid]['destroy'] + if conf_uuid in self.conf.configs: + should_delete = self.conf.configs[conf_uuid]['destroy'] + else: + # Could not find UUID in config, switch to 'never' + should_delete = "never" # TODO: also handle 'unchanged' if should_delete == "always": logging.warning("TODO: Delete from Trove") @@ -121,6 +125,7 @@ class LorryController(cliapp.Application): store_state = False if store_state: mgr.lorry_state[new_lorry] = { + 'destroy': conf['destroy'], 'conf': conf_uuid, 'lorry': lorry, 'next-due': nextdue, @@ -140,6 +145,7 @@ class LorryController(cliapp.Application): conf_uuid = lorry['controller-uuid'] nextdue = self.conf.duetimes[upd_lorry] mgr.lorry_state[upd_lorry] = { + 'destroy': conf['destroy'], 'conf': conf_uuid, 'lorry': lorry, 'next-due': nextdue, |