From 228538cff59581b2c7e9f94f5ce91f197efa754c Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Fri, 6 Jun 2008 09:27:49 +0000
Subject: [PATCH] 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
---
 lib/serializer.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/serializer.py b/lib/serializer.py
index d00dbc593..7345c79e7 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
-- 
GitLab