fixup hosts after class change
This commit is contained in:
@@ -83,6 +83,14 @@ class Host:
|
|||||||
self.cmds = []
|
self.cmds = []
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
|
|
||||||
|
# called when reloading class from pickle
|
||||||
|
def fixup(self):
|
||||||
|
try:
|
||||||
|
a=self.cmds
|
||||||
|
except:
|
||||||
|
self.cmds=[]
|
||||||
|
|
||||||
def getstate(self):
|
def getstate(self):
|
||||||
return self.state
|
return self.state
|
||||||
|
|
||||||
@@ -744,6 +752,8 @@ if os.path.exists(PICKFILE):
|
|||||||
pickf.close()
|
pickf.close()
|
||||||
except:
|
except:
|
||||||
os.unlink(PICKFILE)
|
os.unlink(PICKFILE)
|
||||||
|
for h in hosts.keys():
|
||||||
|
hosts[h].fixup()
|
||||||
for h in drophosts:
|
for h in drophosts:
|
||||||
if h in hosts: # was: hosts.has_key(h):
|
if h in hosts: # was: hosts.has_key(h):
|
||||||
del hosts[h]
|
del hosts[h]
|
||||||
|
|||||||
Reference in New Issue
Block a user