Compatible with python2 and 3 string check 39/65439/3
authorcope.li <cope.li@huawei.com>
Wed, 28 Nov 2018 03:25:04 +0000 (11:25 +0800)
committerEmma Foley <emma.l.foley@intel.com>
Fri, 7 Dec 2018 15:46:49 +0000 (15:46 +0000)
JIRA:YARDSTICK-1557

Change-Id: I54ee4d6ef835e8e6ecd55cfa305151e842f88b03
Signed-off-by: cope.li <cope.li@huawei.com>
yardstick/benchmark/core/task.py

index 1dfd6c3..477dbcc 100644 (file)
@@ -11,6 +11,7 @@ import sys
 import os
 from collections import OrderedDict
 
+import six
 import yaml
 import atexit
 import ipaddress
@@ -313,7 +314,7 @@ class Task(object):     # pragma: no cover
             return {k: self._parse_options(v) for k, v in op.items()}
         elif isinstance(op, list):
             return [self._parse_options(v) for v in op]
-        elif isinstance(op, str):
+        elif isinstance(op, six.string_types):
             return self.outputs.get(op[1:]) if op.startswith('$') else op
         else:
             return op