From: Ross Brattain Date: Thu, 10 Nov 2016 09:26:09 +0000 (-0800) Subject: contexts/node: default to pod.yaml X-Git-Tag: danube.1.0~205^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F75%2F24175%2F1;p=yardstick.git contexts/node: default to pod.yaml We used to default to /etc/yardstick/nodes/pod.yaml but this was changed Recently I got a weird error 2016-11-10 01:18:03,404 - INFO - yardstick.benchmark.contexts.node - Parsing pod file: /root/isb/yardstick/ [Errno 21] Is a directory: '/root/isb/yardstick/' It looks like if file attr is not defined we default to self.file_path = "" which leads to a path ending with a '/' which is a directory so we get the weird Errno 21 error. I think we want to default to pod.yaml in YARDSTICK_ROOT_PATH JIRA: YARDSTICK-364 Change-Id: Iab1a2b935d1e380edc208af3ce4e4758e8424bfe Signed-off-by: Ross Brattain --- diff --git a/yardstick/benchmark/contexts/node.py b/yardstick/benchmark/contexts/node.py index c4e603a46..67db442d2 100644 --- a/yardstick/benchmark/contexts/node.py +++ b/yardstick/benchmark/contexts/node.py @@ -35,9 +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", "") + self.file_path = attrs.get("file", "pod.yaml") if not os.path.exists(self.file_path): - self.file_path = YARDSTICK_ROOT_PATH + self.file_path + self.file_path = os.path.join(YARDSTICK_ROOT_PATH, self.file_path) LOG.info("Parsing pod file: %s", self.file_path)