+ self.external_network = self.options.get("external_network", "ext-net")
+ self.ping_options = "-s %s -c %s" % \
+ (self.options.get("packetsize", '56'),
+ self.options.get("ping_count", '5'))
+ self.openrc = self.options.get("openrc", "/opt/admin-openrc.sh")
+
+ def _ssh_host(self, node_name):
+ # ssh host
+ node = self.nodes.get(node_name, None)
+ user = node.get('user', 'ubuntu')
+ ip = node.get('ip', None)
+ pwd = node.get('password', None)
+ key_fname = node.get('key_filename', '/root/.ssh/id_rsa')
+
+ if pwd is not None:
+ LOG.debug("Log in via pw, user:%s, host:%s, password:%s",
+ user, ip, pwd)
+ self.client = ssh.SSH(user, ip, password=pwd)
+ else:
+ LOG.debug("Log in via key, user:%s, host:%s, key_filename:%s",
+ user, ip, key_fname)
+ self.client = ssh.SSH(user, ip, key_filename=key_fname)
+ self.client.wait(timeout=60)