X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fscenarios%2Favailability%2Fscenario_general.py;h=a950ef9336448044f63c3ac7cfc4e4727c831936;hb=a8298ad4738a6a0b45728bb6c73b6d21bc7c4350;hp=0a128aa09484b0389c040de886779877c2f01ff1;hpb=567694e4db2d0776db6c115b98f54a4737e52124;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/availability/scenario_general.py b/yardstick/benchmark/scenarios/availability/scenario_general.py index 0a128aa09..a950ef933 100644 --- a/yardstick/benchmark/scenarios/availability/scenario_general.py +++ b/yardstick/benchmark/scenarios/availability/scenario_general.py @@ -6,8 +6,8 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +from __future__ import absolute_import import logging -import traceback from yardstick.benchmark.scenarios import base from yardstick.benchmark.scenarios.availability.director import Director @@ -22,7 +22,7 @@ class ScenarioGeneral(base.Scenario): def __init__(self, scenario_cfg, context_cfg): LOG.debug( - "scenario_cfg:%s context_cfg:%s" % (scenario_cfg, context_cfg)) + "scenario_cfg:%s context_cfg:%s", scenario_cfg, context_cfg) self.scenario_cfg = scenario_cfg self.context_cfg = context_cfg @@ -34,8 +34,8 @@ class ScenarioGeneral(base.Scenario): orderedSteps = sorted(steps, key=lambda x: x['index']) for step in orderedSteps: LOG.debug( - "\033[94m running step: {0} .... \033[0m" - .format(orderedSteps.index(step)+1)) + "\033[94m running step: %s .... \033[0m", + orderedSteps.index(step) + 1) try: actionPlayer = self.director.createActionPlayer( step['actionType'], step['actionKey']) @@ -44,12 +44,11 @@ class ScenarioGeneral(base.Scenario): step['actionType'], step['actionKey']) if actionRollbacker: self.director.executionSteps.append(actionRollbacker) - except Exception, e: - LOG.debug(e.message) - traceback.print_exc() + except Exception: + LOG.exception("Exception") LOG.debug( - "\033[91m exception when running step: {0} .... \033[0m" - .format(orderedSteps.index(step))) + "\033[91m exception when running step: %s .... \033[0m", + orderedSteps.index(step)) break finally: pass