diff --git a/launch/launch-node.py b/launch/launch-node.py index ed084dd27c..e0a9d97343 100755 --- a/launch/launch-node.py +++ b/launch/launch-node.py @@ -34,6 +34,8 @@ import utils import openstack import paramiko +from sshclient import SSHException + SCRIPT_DIR = os.path.dirname(sys.argv[0]) try: @@ -100,9 +102,14 @@ def bootstrap_server(server, key, name, volume_device, keep, ssh_kwargs = dict(pkey=key) print("--- Running initial configuration on host %s ---" % ip) + ssh_client = None for username in ['root', 'ubuntu', 'centos', 'admin']: - ssh_client = utils.ssh_connect(ip, username, ssh_kwargs, - timeout=timeout) + try: + ssh_client = utils.ssh_connect(ip, username, ssh_kwargs, + timeout=timeout) + except SSHException: + print("Username: " + username + " failed to ssh. " + "Trying next option.") if ssh_client: break