Merge "Adding cpu set to enable affinity for given vcpu"
[yardstick.git] / yardstick / common / utils.py
index 68c9ed6..51f6e13 100644 (file)
@@ -37,7 +37,6 @@ from oslo_utils import importutils
 from oslo_serialization import jsonutils
 
 import yardstick
-from yardstick.common.yaml_loader import yaml_load
 
 logger = logging.getLogger(__name__)
 logger.setLevel(logging.DEBUG)
@@ -94,19 +93,6 @@ def import_modules_from_package(package):
                 logger.exception("unable to import %s", module_name)
 
 
-def parse_yaml(file_path):
-    try:
-        with open(file_path) as f:
-            value = yaml_load(f)
-    except IOError:
-        return {}
-    except OSError as e:
-        if e.errno != errno.EEXIST:
-            raise
-    else:
-        return value
-
-
 def makedirs(d):
     try:
         os.makedirs(d)
@@ -364,7 +350,7 @@ def config_to_dict(config):
 
 
 def validate_non_string_sequence(value, default=None, raise_exc=None):
-    if isinstance(value, collections.Sequence) and not isinstance(value, str):
+    if isinstance(value, collections.Sequence) and not isinstance(value, six.string_types):
         return value
     if raise_exc:
         raise raise_exc