diff options
author | 2016-10-17 06:30:16 +0000 | |
---|---|---|
committer | 2016-10-17 06:30:16 +0000 | |
commit | f889d6136e7a23d3db678c53ed0da3eea421cd68 (patch) | |
tree | 8f9e1c2c0549bf18369e6701c61208683ba5871a /yardstick/benchmark/contexts/node.py | |
parent | c5c9a48610bb587f25135f1d0758472c1fbe876c (diff) | |
parent | 1065e856c9dc938652556fc535a0ec47f8a0dc08 (diff) |
Merge "Bugfix: no pod.yaml file error when run test case not in the root path"
Diffstat (limited to 'yardstick/benchmark/contexts/node.py')
-rw-r--r-- | yardstick/benchmark/contexts/node.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/yardstick/benchmark/contexts/node.py b/yardstick/benchmark/contexts/node.py index c3d652119..c4e603a46 100644 --- a/yardstick/benchmark/contexts/node.py +++ b/yardstick/benchmark/contexts/node.py @@ -8,10 +8,12 @@ ############################################################################## import sys +import os import yaml import logging from yardstick.benchmark.contexts.base import Context +from yardstick.definitions import YARDSTICK_ROOT_PATH LOG = logging.getLogger(__name__) @@ -33,7 +35,9 @@ class NodeContext(Context): def init(self, attrs): '''initializes itself from the supplied arguments''' self.name = attrs["name"] - self.file_path = attrs.get("file", "/etc/yardstick/nodes/pod.yaml") + self.file_path = attrs.get("file", "") + if not os.path.exists(self.file_path): + self.file_path = YARDSTICK_ROOT_PATH + self.file_path LOG.info("Parsing pod file: %s", self.file_path) |