""" Handler for yardstick command 'scenario' """
-from yardstick.benchmark.scenarios.base import Scenario
+from __future__ import print_function
+from __future__ import absolute_import
+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):
- '''Scenario commands.
+class ScenarioCommands(object): # pragma: no cover
+ """Scenario commands.
Set of commands to discover and display scenario types.
- '''
+ """
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)
+ """List existing scenario types"""
+ 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__
+ """Show details of a specific scenario type"""
+ param = change_osloobj_to_paras(args)
+ Scenarios().show(param)