diff options
Diffstat (limited to 'yardstick/benchmark/scenarios/availability/attacker')
4 files changed, 15 insertions, 15 deletions
diff --git a/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py b/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py index 6561f6b65..3b1f8ef76 100644 --- a/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py +++ b/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py @@ -24,7 +24,7 @@ def _execute_shell_command(command, stdin=None): except Exception: exitcode = -1 output = traceback.format_exc() - LOG.error("exec command '%s' error:\n " % command) + LOG.error("exec command '%s' error:\n ", command) LOG.error(traceback.format_exc()) return exitcode, output @@ -34,7 +34,7 @@ class BaremetalAttacker(BaseAttacker): __attacker_type__ = 'bare-metal-down' def setup(self): - LOG.debug("config:%s context:%s" % (self._config, self._context)) + LOG.debug("config:%s context:%s", self._config, self._context) host = self._context.get(self._config['host'], None) ip = host.get("ip", None) user = host.get("user", "root") @@ -65,10 +65,10 @@ class BaremetalAttacker(BaseAttacker): "/bin/sh -s {0} -W 10".format(self.host_ip), stdin=open(self.check_script, "r")) - LOG.debug("check ret: %s out:%s err:%s" % - (exit_status, stdout, stderr)) + LOG.debug("check ret: %s out:%s err:%s", + exit_status, stdout, stderr) if not stdout or "running" not in stdout: - LOG.info("the host (ipmi_ip:%s) is not running!" % self.ipmi_ip) + LOG.info("the host (ipmi_ip:%s) is not running!", self.ipmi_ip) return False return True @@ -76,8 +76,8 @@ class BaremetalAttacker(BaseAttacker): def inject_fault(self): exit_status, stdout, stderr = self.connection.execute( "shutdown -h now") - LOG.debug("inject fault ret: %s out:%s err:%s" % - (exit_status, stdout, stderr)) + LOG.debug("inject fault ret: %s out:%s err:%s", + exit_status, stdout, stderr) if not exit_status: LOG.info("inject fault success") @@ -91,7 +91,7 @@ class BaremetalAttacker(BaseAttacker): ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT) pwd = host.get("pwd", None) - LOG.debug("jump_host ip:%s user:%s" % (ip, user)) + LOG.debug("jump_host ip:%s user:%s", ip, user) self.jump_connection = ssh.SSH(user, ip, password=pwd, port=ssh_port) self.jump_connection.wait(timeout=600) diff --git a/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py b/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py index 5e7716e49..a452c37ac 100644 --- a/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py +++ b/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py @@ -20,7 +20,7 @@ class GeneralAttacker(BaseAttacker): __attacker_type__ = 'general-attacker' def setup(self): - LOG.debug("config:%s context:%s" % (self._config, self._context)) + LOG.debug("config:%s context:%s", self._config, self._context) host = self._context.get(self._config['host'], None) ip = host.get("ip", None) user = host.get("user", "root") @@ -79,8 +79,8 @@ class GeneralAttacker(BaseAttacker): .format(stdout)) else: LOG.error( - "the inject_fault's error, stdout:%s, stderr:%s" % - (stdout, stderr)) + "the inject_fault's error, stdout:%s, stderr:%s", + stdout, stderr) def recover(self): if "rollback_parameter" in self._config: diff --git a/yardstick/benchmark/scenarios/availability/attacker/attacker_process.py b/yardstick/benchmark/scenarios/availability/attacker/attacker_process.py index 0a844f56c..2ccc231da 100644 --- a/yardstick/benchmark/scenarios/availability/attacker/attacker_process.py +++ b/yardstick/benchmark/scenarios/availability/attacker/attacker_process.py @@ -19,7 +19,7 @@ class ProcessAttacker(BaseAttacker): __attacker_type__ = 'kill-process' def setup(self): - LOG.debug("config:%s context:%s" % (self._config, self._context)) + LOG.debug("config:%s context:%s", self._config, self._context) host = self._context.get(self._config['host'], None) ip = host.get("ip", None) user = host.get("user", "root") @@ -54,8 +54,8 @@ class ProcessAttacker(BaseAttacker): return True else: LOG.error( - "the host envrioment is error, stdout:%s, stderr:%s" % - (stdout, stderr)) + "the host envrioment is error, stdout:%s, stderr:%s", + stdout, stderr) return False def inject_fault(self): diff --git a/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py b/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py index 78276efa2..f96e57728 100644 --- a/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py +++ b/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py @@ -26,7 +26,7 @@ class AttackerMgr(object): self._attacker_list = [] def init_attackers(self, attacker_cfgs, context): - LOG.debug("attackerMgr confg: %s" % attacker_cfgs) + LOG.debug("attackerMgr confg: %s", attacker_cfgs) for cfg in attacker_cfgs: attacker_cls = BaseAttacker.get_attacker_cls(cfg) |