diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-01-26 17:10:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-01-26 17:10:25 +0000 |
commit | c277f40e639c40c00a62bb84eda18dd0b8f7797e (patch) | |
tree | 6bb8ab98944c122558f1405b0735548eca88e5a7 /testcases/vPing/CI/libraries/vPing2.py | |
parent | 7e6dc039febd23ce7a4b2a27e5b8477ebf4d0a91 (diff) | |
parent | a43fac229e1be8c6af2c72a4be9d9c1c95614d21 (diff) |
Merge "Add timeout in paramiko ssh command"
Diffstat (limited to 'testcases/vPing/CI/libraries/vPing2.py')
-rw-r--r-- | testcases/vPing/CI/libraries/vPing2.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/testcases/vPing/CI/libraries/vPing2.py b/testcases/vPing/CI/libraries/vPing2.py index 358223585..912627b76 100644 --- a/testcases/vPing/CI/libraries/vPing2.py +++ b/testcases/vPing/CI/libraries/vPing2.py @@ -443,26 +443,26 @@ def main(): port_id1, port_id2) return (EXIT_CODE) - logger.info("Trying to stablish SSH connection to %s..." % floatip) + logger.info("Trying to establish SSH connection to %s..." % floatip) username='cirros' password='cubswin:)' ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - timeout = 50 + timeout = 20 while timeout > 0: try: - ssh.connect(floatip, username=username, password=password) - logger.debug("Floating IP '%s' is ssh-able!" % floatip) + ssh.connect(floatip, username=username, password=password, timeout=10) + logger.debug("SSH connection established to %s." % floatip) break except Exception, e: #print e logger.debug("Waiting for %s..." % floatip) - time.sleep(6) + time.sleep(2) timeout -= 1 if timeout == 0: # 300 sec timeout (5 min) - logger.error("Cannot ping the floating IP '%s'." % floatip) + logger.error("Cannot establish connection to IP '%s'. Aborting" % floatip) cleanup(nova_client, neutron_client, image_id, network_dic, port_id1, port_id2) return (EXIT_CODE) |