diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index 92aee836b96..2da9272c7aa 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -109,7 +109,7 @@ def cleanup_resources(api_client, resources): obj.delete(api_client) -def is_server_ssh_ready(ipaddress, port, username, password, retries=5, timeout=20, keyPairFileLocation=None): +def is_server_ssh_ready(ipaddress, port, username, password, retries=5, timeout=30, keyPairFileLocation=None): """Return ssh handle else wait till sshd is running""" try: ssh = remoteSSHClient( diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py index 764ba2eb95f..e0ead9315a9 100644 --- a/tools/marvin/marvin/remoteSSHClient.py +++ b/tools/marvin/marvin/remoteSSHClient.py @@ -17,6 +17,7 @@ import paramiko import time +import socket import cloudstackException import contextlib import logging @@ -57,10 +58,10 @@ class remoteSSHClient(object): (str(host), user, keyPairFileLocation)) self.logger.debug("SSH connect: %s@%s with passwd %s" % (user, str(host), passwd)) - except paramiko.SSHException, sshex: + except (paramiko.SSHException, paramiko.ChannelException, socket.error) as se: if retry_count == 0: raise cloudstackException. \ - InvalidParameterException(repr(sshex)) + InvalidParameterException(repr(se)) retry_count = retry_count - 1 time.sleep(delay) except paramiko.AuthenticationException, authEx: @@ -68,8 +69,6 @@ class remoteSSHClient(object): InvalidParameterException("Invalid credentials to " + "login to %s on port %s" % (str(host), port)) - else: - return self.ssh def execute(self, command): stdin, stdout, stderr = self.ssh.exec_command(command)