calvinsys: Preserve the object reference in serialize()
@@ -185,7 +185,6 @@ class CalvinSys(object):
"""
Close and free all open calvinsys objects for given actor
"""
-
if actor in self._actors:
references = self._actors.pop(actor)
for ref in references:
@@ -196,16 +195,16 @@ class CalvinSys(object):
serializes calvinsys objects used by given actor
"""
if actor in self._actors:
- references = self._actors.pop(actor)
+ references = self._actors.get(actor)
else :
# Nothing to do here
return {}
serz = {}
for ref in references:
- csobj = self._objects.pop(ref)
- csobj["obj"] = csobj["obj"].serialize() # serialize object
- serz[ref] = csobj
+ csobj = self._objects.get(ref)
+ state = csobj["obj"].serialize() # serialize object
+ serz[ref] = {"name": csobj["name"], "obj": state, "args": csobj["args"]}
return serz
def deserialize(self, actor, csobjects):
