Merge "Yardstick Preliminary Documentation"
[yardstick.git] / yardstick / common / template_format.py
index 2deaf39..e1662ce 100644 (file)
 
 # yardstick: this file is copied from python-heatclient and slightly modified
 
-import json
+from __future__ import absolute_import
+
 import yaml
+from oslo_serialization import jsonutils
 
 if hasattr(yaml, 'CSafeLoader'):
     yaml_loader = yaml.CSafeLoader
@@ -40,13 +42,13 @@ yaml_loader.add_constructor(u'tag:yaml.org,2002:timestamp',
 
 
 def parse(tmpl_str):
-    '''Takes a string and returns a dict containing the parsed structure.
+    """Takes a string and returns a dict containing the parsed structure.
 
     This includes determination of whether the string is using the
     JSON or YAML format.
-    '''
+    """
     if tmpl_str.startswith('{'):
-        tpl = json.loads(tmpl_str)
+        tpl = jsonutils.loads(tmpl_str)
     else:
         try:
             tpl = yaml.load(tmpl_str, Loader=yaml_loader)