Enable the MQ producer in "SampleVNFTrafficGen" class
[yardstick.git] / yardstick / common / utils.py
index f9fe0e3..251e5cc 100644 (file)
@@ -37,6 +37,7 @@ from oslo_utils import encodeutils
 
 import yardstick
 from yardstick.common import exceptions
+from yardstick.common.yaml_loader import yaml_load
 
 
 logger = logging.getLogger(__name__)
@@ -527,3 +528,11 @@ def wait_until_true(predicate, timeout=60, sleep=1, exception=None):
         if exception and issubclass(exception, Exception):
             raise exception  # pylint: disable=raising-bad-type
         raise exceptions.WaitTimeout
+
+
+def read_yaml_file(path):
+    """Read yaml file"""
+
+    with open(path) as stream:
+        data = yaml_load(stream)
+    return data