cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject git commit: updated refs/heads/master to a3df696
Date Thu, 01 Aug 2013 01:29:31 GMT
Updated Branches:
  refs/heads/master 6ea9d8b15 -> a3df696fd


Automation: Fix SSH connection test

And increase default retry to 10 times, each 30 seconds.

Comment out auth exception part because sometime it caused failure when VM
is starting up.

Now we just wait anyway for 5 minutes if it's failing.


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

Branch: refs/heads/master
Commit: a3df696fd63ad58a07e5f677210d6aefb1680742
Parents: 6ea9d8b
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Wed Jul 31 18:27:11 2013 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Wed Jul 31 18:28:33 2013 -0700

----------------------------------------------------------------------
 tools/marvin/marvin/integration/lib/utils.py |  2 +-
 tools/marvin/marvin/remoteSSHClient.py       | 24 ++++++++++++-----------
 2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3df696f/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 2da9272..6d10132 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=30, keyPairFileLocation=None):
+def is_server_ssh_ready(ipaddress, port, username, password, retries=10, 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/a3df696f/tools/marvin/marvin/remoteSSHClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py
index e0ead93..fea9b12 100644
--- a/tools/marvin/marvin/remoteSSHClient.py
+++ b/tools/marvin/marvin/remoteSSHClient.py
@@ -17,7 +17,6 @@
 
 import paramiko
 import time
-import socket
 import cloudstackException
 import contextlib
 import logging
@@ -25,7 +24,7 @@ from contextlib import closing
 
 
 class remoteSSHClient(object):
-    def __init__(self, host, port, user, passwd, retries=5, delay=30,
+    def __init__(self, host, port, user, passwd, retries=10, delay=30,
                  log_lvl=logging.INFO, keyPairFileLocation=None):
         self.host = host
         self.port = port
@@ -40,7 +39,7 @@ class remoteSSHClient(object):
         self.logger.addHandler(ch)
 
         retry_count = retries
-        while True:
+        while retry_count >= 0:
             try:
                 if keyPairFileLocation is None:
                     self.ssh.connect(str(host), int(port), user, passwd)
@@ -58,17 +57,20 @@ class remoteSSHClient(object):
                         (str(host), user, keyPairFileLocation))
                     self.logger.debug("SSH connect: %s@%s with passwd %s" %
                                       (user, str(host), passwd))
-            except (paramiko.SSHException, paramiko.ChannelException, socket.error) as se:
+            #except paramiko.AuthenticationException, authEx:
+            #    raise cloudstackException. \
+            #        InvalidParameterException("Invalid credentials to "
+            #                                  + "login to %s on port %s" %
+            #                                  (str(host), port))
+            except Exception as se:
                 if retry_count == 0:
                     raise cloudstackException. \
                         InvalidParameterException(repr(se))
-                retry_count = retry_count - 1
-                time.sleep(delay)
-            except paramiko.AuthenticationException, authEx:
-                raise cloudstackException. \
-                    InvalidParameterException("Invalid credentials to "
-                                              + "login to %s on port %s" %
-                                              (str(host), port))
+            else:
+                return
+
+            retry_count = retry_count - 1
+            time.sleep(delay)
 
     def execute(self, command):
         stdin, stdout, stderr = self.ssh.exec_command(command)


Mime
View raw message