Merge "Add how to add/modify Yardstick Grafana dashboard in user guide"
[yardstick.git] / yardstick / benchmark / scenarios / availability / operation / operation_general.py
index d413716..aa28472 100644 (file)
@@ -23,13 +23,16 @@ class GeneralOperaion(BaseOperation):
         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!")
 
         self.key = self._config['key']
+        self.operation_key = self._config['operation_key']
 
         if "action_parameter" in self._config:
             actionParameter = self._config['action_parameter']
@@ -43,7 +46,8 @@ class GeneralOperaion(BaseOperation):
             l = list(item for item in rollbackParameter.values())
             self.rollback_param = str.format(*l)
 
-        self.operation_cfgs = BaseOperation.operation_cfgs.get(self.key)
+        self.operation_cfgs = BaseOperation.operation_cfgs.get(
+            self.operation_key)
         self.action_script = self.get_script_fullpath(
             self.operation_cfgs['action_script'])
         self.rollback_script = self.get_script_fullpath(