Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "[workaround] Disable gui for aarch64"
[yardstick.git]
/
yardstick
/
common
/
yaml_loader.py
diff --git
a/yardstick/common/yaml_loader.py
b/yardstick/common/yaml_loader.py
index
0572bd5
..
18673be
100644
(file)
--- a/
yardstick/common/yaml_loader.py
+++ b/
yardstick/common/yaml_loader.py
@@
-10,10
+10,6
@@
# License for the specific language governing permissions and limitations
# under the License.
# License for the specific language governing permissions and limitations
# under the License.
-# yardstick: this file is copied from python-heatclient and slightly modified
-
-from __future__ import absolute_import
-
import yaml
import yaml
@@
-23,6
+19,7
@@
if hasattr(yaml, 'CSafeLoader'):
else:
yaml_loader = type('CustomLoader', (yaml.SafeLoader,), {})
else:
yaml_loader = type('CustomLoader', (yaml.SafeLoader,), {})
+
if hasattr(yaml, 'CSafeDumper'):
yaml_dumper = yaml.CSafeDumper
else:
if hasattr(yaml, 'CSafeDumper'):
yaml_dumper = yaml.CSafeDumper
else:
@@
-31,3
+28,10
@@
else:
def yaml_load(tmpl_str):
return yaml.load(tmpl_str, Loader=yaml_loader)
def yaml_load(tmpl_str):
return yaml.load(tmpl_str, Loader=yaml_loader)
+
+
+def read_yaml_file(path):
+ """Read yaml file"""
+ with open(path) as stream:
+ data = yaml_load(stream)
+ return data