From: Alex Yang Date: Wed, 24 Jan 2018 01:17:34 +0000 (+0800) Subject: Break dead loop in discover_host() X-Git-Tag: opnfv-6.0.0~12 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F23%2F51023%2F2;p=daisy.git Break dead loop in discover_host() Change-Id: I5e0186db88c9db16a8212b1c52e03fb9d6cf6adc Signed-off-by: Alex Yang --- diff --git a/deploy/tempest.py b/deploy/tempest.py index 0c48d778..e403cd2f 100644 --- a/deploy/tempest.py +++ b/deploy/tempest.py @@ -164,13 +164,16 @@ def install_os_for_vm_step2(cluster_id, client): def discover_host(hosts_name, client): - while True: + retry = 90 + while retry: hosts_info = get_hosts(client) if len(hosts_info) == len(hosts_name): print('discover hosts success!') - break + return else: time.sleep(10) + retry = retry - 1 + err_exit('Failed to discover hosts') def update_network(cluster_id, network_map, client):