From 3fc24b6b7f49f4e843f8fb6288c2f9f9e6c9c083 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 16 Sep 2015 10:32:17 -0700 Subject: [PATCH] Add support for 'admin' user for OVH OVH images have, of course, yet another 'root' user they would like us to use instead of root. Change-Id: If8cc3d31862e352eed40fc041a4c6c695a35063a --- launch/launch-node.py | 2 +- launch/utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/launch/launch-node.py b/launch/launch-node.py index b2005766a1..aeeac50724 100755 --- a/launch/launch-node.py +++ b/launch/launch-node.py @@ -67,7 +67,7 @@ def bootstrap_server(server, admin_pass, key, cert, environment, name, else: ssh_kwargs['password'] = admin_pass - for username in ['root', 'ubuntu', 'centos']: + for username in ['root', 'ubuntu', 'centos', 'admin']: ssh_client = utils.ssh_connect(ip, username, ssh_kwargs, timeout=600) if ssh_client: break diff --git a/launch/utils.py b/launch/utils.py index 997e344ca0..1cb835fc10 100644 --- a/launch/utils.py +++ b/launch/utils.py @@ -179,6 +179,8 @@ def ssh_connect(ip, username, connect_kwargs={}, timeout=60): except socket.error as e: print "While testing ssh access:", e time.sleep(5) + except paramiko.ssh_exception.AuthenticationException: + return None ret, out = client.ssh("echo access okay") if "access okay" in out: