aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/core
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2017-11-07 16:27:43 +0000
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2017-11-07 16:27:43 +0000
commit37dd0cbbcbcb1aa00b7f3aa2e74a6775c6a7f2fb (patch)
tree08824715b0dd267cde0d503c00a91df7f2b399d9 /yardstick/benchmark/core
parent5a756e6171ad2d867914793dc2fd8b1aa7a19a6e (diff)
Create get_description and get_scenario_type for Scenario
Created two new class functions for Scenario class: * "get_description" will return the first line of the docstring, if exists. * "get_scenario_type" will return the value of "__scenario_type__" variable. Change-Id: I8e3b47e33e0bae101b874c3975bb9c383397d188 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/benchmark/core')
-rw-r--r--yardstick/benchmark/core/scenario.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/yardstick/benchmark/core/scenario.py b/yardstick/benchmark/core/scenario.py
index cd119c24c..28eb65230 100644
--- a/yardstick/benchmark/core/scenario.py
+++ b/yardstick/benchmark/core/scenario.py
@@ -10,7 +10,6 @@
""" Handler for yardstick command 'scenario' """
from __future__ import absolute_import
-from __future__ import print_function
from yardstick.benchmark.scenarios.base import Scenario
from yardstick.benchmark.core import print_hbar
@@ -27,9 +26,9 @@ class Scenarios(object): # pragma: no cover
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]))
+ for scenario_class in types:
+ print("| %-16s | %-60s" % (scenario_class.get_scenario_type(),
+ scenario_class.get_description()))
print_hbar(78)
def show(self, args):