X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fscenarios%2Favailability%2Fdirector.py;h=e0d05ebf5ba805b633c44fb2aa797bc6edba6b99;hb=1ff9df7e724eb0c981aebd5f5b8aa90db0da292b;hp=267933dd05e82320b50c3da2e842cdc4f64e61e4;hpb=bd67f539aa7ad9a659b7d945942e1eeda96c45d7;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/availability/director.py b/yardstick/benchmark/scenarios/availability/director.py index 267933dd0..e0d05ebf5 100644 --- a/yardstick/benchmark/scenarios/availability/director.py +++ b/yardstick/benchmark/scenarios/availability/director.py @@ -6,6 +6,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +from __future__ import absolute_import import logging from yardstick.benchmark.scenarios.availability.monitor import basemonitor @@ -23,7 +24,7 @@ LOG = logging.getLogger(__name__) class Director(object): """ Director is used to direct a test scenaio - including the creation of action players, test result verification + including the creation of action players, test result verification and rollback of actions. """ @@ -32,6 +33,7 @@ class Director(object): # A stack store Rollbacker that will be called after # all actionplayers finish. self.executionSteps = [] + self.data = {} self.scenario_cfg = scenario_cfg self.context_cfg = context_cfg @@ -41,12 +43,14 @@ class Director(object): LOG.debug("start init attackers...") attacker_cfgs = self.scenario_cfg["options"]["attackers"] self.attackerMgr = baseattacker.AttackerMgr() - self.attackerMgr.init_attackers(attacker_cfgs, nodes) + self.data = self.attackerMgr.init_attackers(attacker_cfgs, + nodes) + # setup monitors if "monitors" in self.scenario_cfg["options"]: LOG.debug("start init monitors...") monitor_cfgs = self.scenario_cfg["options"]["monitors"] - self.monitorMgr = basemonitor.MonitorMgr() + self.monitorMgr = basemonitor.MonitorMgr(self.data) self.monitorMgr.init_monitors(monitor_cfgs, nodes) # setup operations if "operations" in self.scenario_cfg["options"]: @@ -63,7 +67,7 @@ class Director(object): def createActionPlayer(self, type, key): LOG.debug( - "the type of current action is %s, the key is %s" % (type, key)) + "the type of current action is %s, the key is %s", type, key) if type == ActionType.ATTACKER: return actionplayers.AttackerPlayer(self.attackerMgr[key]) if type == ActionType.MONITOR: @@ -77,13 +81,13 @@ class Director(object): def createActionRollbacker(self, type, key): LOG.debug( - "the type of current action is %s, the key is %s" % (type, key)) + "the type of current action is %s, the key is %s", type, key) if type == ActionType.ATTACKER: return actionrollbackers.AttackerRollbacker(self.attackerMgr[key]) if type == ActionType.OPERATION: return actionrollbackers.OperationRollbacker( self.operationMgr[key]) - LOG.debug("no rollbacker created for %s" % (key)) + LOG.debug("no rollbacker created for %s", key) def verify(self): result = True