summaryrefslogtreecommitdiffstats
path: root/yardstick/cmd/commands/scenario.py
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2016-12-29 11:45:12 +0000
committerchenjiankun <chenjiankun1@huawei.com>2016-12-30 16:55:11 +0000
commit57011bd0769f54a98b90d489df0f38751ca76c0e (patch)
treeed6b3259a9bf9af4519c328acb9aa03d080b3acb /yardstick/cmd/commands/scenario.py
parent26071f849bd08aa289792346c7821374acb6c696 (diff)
Split Yardstick CLI with Yardstick core logic
JIRA: YARDSTICK-511 We need to unify yardstick entry. Now the solution is using CLI call API as nova do. This is the first step: coupling the yardstick core logic from CLI. Moving the core logic to yardstick/benchmark/core and the CLI using a object to call yardstick core logic. Change-Id: I84f10d2134635880c281cc63212a8533f2dd7d4e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/cmd/commands/scenario.py')
-rw-r--r--yardstick/cmd/commands/scenario.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/yardstick/cmd/commands/scenario.py b/yardstick/cmd/commands/scenario.py
index 00d46cf11..6aa3a451a 100644
--- a/yardstick/cmd/commands/scenario.py
+++ b/yardstick/cmd/commands/scenario.py
@@ -9,9 +9,9 @@
""" Handler for yardstick command 'scenario' """
-from yardstick.benchmark.scenarios.base import Scenario
+from yardstick.benchmark.core.scenario import Scenarios
from yardstick.common.utils import cliargs
-from yardstick.cmd import print_hbar
+from yardstick.cmd.commands import change_osloobj_to_paras
class ScenarioCommands(object):
@@ -22,17 +22,11 @@ class ScenarioCommands(object):
def do_list(self, args):
'''List existing scenario types'''
- types = Scenario.get_types()
- print_hbar(78)
- print("| %-16s | %-60s" % ("Type", "Description"))
- print_hbar(78)
- for stype in types:
- print("| %-16s | %-60s" % (stype.__scenario_type__,
- stype.__doc__.split("\n")[0]))
- print_hbar(78)
+ param = change_osloobj_to_paras(args)
+ Scenarios().list_all(param)
@cliargs("type", type=str, help="runner type", nargs=1)
def do_show(self, args):
'''Show details of a specific scenario type'''
- stype = Scenario.get_cls(args.type[0])
- print stype.__doc__
+ param = change_osloobj_to_paras(args)
+ Scenarios().show(param)