summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2016-11-07 07:38:40 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-11-07 07:38:40 +0000
commit962e1283835838a127767087a09b946327bd23a6 (patch)
tree983c765ed95d4ac6f692ac0741bf7f9630c68705
parentf908bd72ee7423829c1cc679ef5d04e3768be677 (diff)
parent2f650cc150e966781e971cace1762b71fc320f75 (diff)
Merge "Directory independant 'perftest list' command execution."
-rw-r--r--cli/commands/perftest.py4
-rw-r--r--cli/helper.py14
2 files changed, 17 insertions, 1 deletions
diff --git a/cli/commands/perftest.py b/cli/commands/perftest.py
index c163070a..0eb6d062 100644
--- a/cli/commands/perftest.py
+++ b/cli/commands/perftest.py
@@ -10,12 +10,14 @@
from prettytable import PrettyTable
import yaml
import click
+import os
+from cli import helper
class PerfTest:
def __init__(self):
- self.path = 'benchmarks/perftest/summary'
+ self.path = os.path.join(helper.fetch_root(), 'perftest/summary')
def list(self):
table = PrettyTable(["Name", "Description"])
diff --git a/cli/helper.py b/cli/helper.py
new file mode 100644
index 00000000..a5865bce
--- /dev/null
+++ b/cli/helper.py
@@ -0,0 +1,14 @@
+##############################################################################
+# Copyright (c) 2016 ZTE Corp and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+import os
+
+
+def fetch_root():
+ return os.path.join(os.path.dirname(__file__), os.pardir, 'benchmarks/')