bootstrap-vz/bootstrapvz/base/remote/__init__.py

27 lines
1,018 B
Python
Raw Normal View History

"""Remote module containing methods to bootstrap remotely
"""
2014-11-24 23:43:17 +01:00
def register_deserialization_handlers():
from Pyro4.util import SerializerBase
SerializerBase.register_dict_to_class('bootstrapvz.base.manifest.Manifest', deserialize_manifest)
SerializerBase.register_dict_to_class('bootstrapvz.base.bootstrapinfo.BootstrapInformation', deserialize_bootstrapinfo)
2014-11-25 21:12:37 +01:00
def unregister_deserialization_handlers():
from Pyro4.util import SerializerBase
SerializerBase.unregister_dict_to_class('bootstrapvz.base.manifest.Manifest')
SerializerBase.unregister_dict_to_class('bootstrapvz.base.bootstrapinfo.BootstrapInformation')
2014-11-24 23:43:17 +01:00
def deserialize_manifest(classname, state):
from bootstrapvz.base.manifest import Manifest
return Manifest(path=state['path'], data=state['data'])
def deserialize_bootstrapinfo(classname, state):
from bootstrapvz.base.bootstrapinfo import BootstrapInformation
bootstrap_info = BootstrapInformation.__new__(BootstrapInformation)
bootstrap_info.__setstate__(state)
return bootstrap_info