You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ya...@apache.org on 2013/08/01 03:27:58 UTC
git commit: updated refs/heads/4.2 to fda0553
Updated Branches:
refs/heads/4.2 7acb023aa -> fda055388
Automation: Fix SSH connection test
And increase default retry to 10 times, each 30 seconds.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fda05538
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fda05538
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fda05538
Branch: refs/heads/4.2
Commit: fda055388e3776cb630e167340f887b4f329339f
Parents: 7acb023
Author: Sheng Yang <sh...@citrix.com>
Authored: Wed Jul 31 18:27:11 2013 -0700
Committer: Sheng Yang <sh...@citrix.com>
Committed: Wed Jul 31 18:27:49 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/fda05538/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/fda05538/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)