# 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
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)