From: Michael Hanselmann Date: Fri, 6 Jun 2008 09:27:49 +0000 (+0000) Subject: Forward-port: Alias Dump/Load functions in ganeti.serializer to DumpJson/LoadJson X-Git-Tag: v2.0.0alpha0~435 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/228538cff59581b2c7e9f94f5ce91f197efa754c Forward-port: Alias Dump/Load functions in ganeti.serializer to DumpJson/LoadJson The remote API will use JSON for the foreseable future, so it's better to put the serialization format in the function name. We can still use another serialization format for Ganeti's core. Reviewed-by: amishchenko, schreiberal --- diff --git a/lib/serializer.py b/lib/serializer.py index d00dbc5..7345c79 100644 --- a/lib/serializer.py +++ b/lib/serializer.py @@ -39,7 +39,7 @@ except TypeError: _RE_EOLSP = re.compile('\s+$', re.MULTILINE) -def Dump(data): +def DumpJson(data): """Serialize a given object. """ @@ -53,8 +53,12 @@ def Dump(data): return txt -def Load(txt): +def LoadJson(txt): """Unserialize data from a string. """ return simplejson.loads(txt) + + +Dump = DumpJson +Load = LoadJson