Merge "Bugfix: debug should be default off"
[yardstick.git] / yardstick / benchmark / scenarios / availability / attacker / attacker_process.py
index 5118ad6..2ccc231 100644 (file)
@@ -19,13 +19,15 @@ 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")
+        ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
         key_filename = host.get("key_filename", "~/.ssh/id_rsa")
 
-        self.connection = ssh.SSH(user, ip, key_filename=key_filename)
+        self.connection = ssh.SSH(user, ip, key_filename=key_filename,
+                                  port=ssh_port)
         self.connection.wait(timeout=600)
         LOG.debug("ssh host success!")
 
@@ -52,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):