- host_user = host.get('user', 'root')
- ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
- host_pwd = host.get('password', 'opnfv')
- host_ip = host.get('ip', None)
-
- LOG.info("user:%s, host:%s", host_user, host_ip)
- self.client = ssh.SSH(host_user, host_ip, password=host_pwd,
- port=ssh_port)
+
+ LOG.info("user:%s, host:%s", host['user'], host['ip'])
+ self.client = ssh.SSH.from_node(host, defaults={
+ "user": "root", "password": "opnfv"
+ })