From 6fe24e8c59ff3dd9a51b57348798c470ee2180f9 Mon Sep 17 00:00:00 2001 From: Andreas Wrede Date: Fri, 25 Oct 2013 19:22:24 +0200 Subject: [PATCH] fixup hosts after class change --- hbd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hbd b/hbd index f98fee6..a1c4173 100755 --- a/hbd +++ b/hbd @@ -83,6 +83,14 @@ class Host: self.cmds = [] num += 1 + + # called when reloading class from pickle + def fixup(self): + try: + a=self.cmds + except: + self.cmds=[] + def getstate(self): return self.state @@ -744,6 +752,8 @@ if os.path.exists(PICKFILE): pickf.close() except: os.unlink(PICKFILE) + for h in hosts.keys(): + hosts[h].fixup() for h in drophosts: if h in hosts: # was: hosts.has_key(h): del hosts[h]