- user = self.context.get("user", "root")
- host = self.context.get("host", None)
- key_filename = self.context.get("key_filename", "~/.ssh/id_rsa")
-
- LOG.info("user:%s, host:%s", user, host)
- self.client = ssh.SSH(user, host, key_filename=key_filename)
+ host = self.context_cfg["host"]
+ user = host.get("user", "root")
+ ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
+ ip = host.get("ip", None)
+ key_filename = host.get("key_filename", "~/.ssh/id_rsa")
+
+ LOG.info("user:%s, host:%s", user, ip)
+ self.client = ssh.SSH(user, ip, key_filename=key_filename,
+ port=ssh_port)