qa_config: Use ganeti.serializer for loading config
authorMichael Hanselmann <hansmi@google.com>
Wed, 29 Sep 2010 15:56:19 +0000 (17:56 +0200)
committerMichael Hanselmann <hansmi@google.com>
Tue, 5 Oct 2010 14:50:32 +0000 (16:50 +0200)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

qa/qa_config.py

index 4afe253..942be8b 100644 (file)
@@ -24,7 +24,8 @@
 """
 
 
-import simplejson
+from ganeti import utils
+from ganeti import serializer
 
 import qa_error
 
@@ -39,11 +40,7 @@ def Load(path):
   """
   global cfg
 
-  f = open(path, 'r')
-  try:
-    cfg = simplejson.load(f)
-  finally:
-    f.close()
+  cfg = serializer.LoadJson(utils.ReadFile(path))
 
   Validate()