fixup hosts after class change

This commit is contained in:
2013-10-25 19:22:24 +02:00
parent 0cc2857dd4
commit 6fe24e8c59
+10
View File
@@ -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]