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=b064c67241568054e957e6ab83989b5f7675ba86;hpb=ce64e77f9e97d3cad4be9c8fee068a2a5b557f3e;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/availability/scenario_general.py b/yardstick/benchmark/scenarios/availability/scenario_general.py index b064c6724..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 @@ -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