cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [1/2] git commit: updated refs/heads/master to cce14f3
Date Wed, 31 Jul 2013 11:50:47 GMT
Updated Branches:
  refs/heads/master 3d9fc3dbc -> cce14f397


Include SSH retry logic when encountering channel failures.

Only on SSHExceptions we attempted retries, but during socket failures,
like Network Unreachable we failed the ssh connection immediately.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit dcbb2fcaa18e3faaf1c0765633300f7d0fa46d2c)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cce14f39
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cce14f39
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cce14f39

Branch: refs/heads/master
Commit: cce14f3974a4928f2a625a93b1bba5bfbd3aad37
Parents: 476bd93
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Wed Jul 31 17:16:48 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Wed Jul 31 17:20:35 2013 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/integration/lib/utils.py | 2 +-
 tools/marvin/marvin/remoteSSHClient.py       | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cce14f39/tools/marvin/marvin/integration/lib/utils.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py
index 92aee83..2da9272 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(

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cce14f39/tools/marvin/marvin/remoteSSHClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py
index 764ba2e..e0ead93 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)


Mime
View raw message