diff options
author | carey.xu <carey.xuhan@huawei.com> | 2016-02-04 10:31:32 +0800 |
---|---|---|
committer | Justin chi <chigang@huawei.com> | 2016-03-16 03:32:51 +0000 |
commit | 06a7351f2686c82354b264cf587bb3ef5d1b6fbf (patch) | |
tree | 24d3065fb0dbfa25a4296bf9aafd7f9d09d0d1c8 /deploy | |
parent | e20b4009b43e1c762640d90673e3765894503efa (diff) |
bugfix: return success when ansible stuck
JIRA: COMPASS-304
Change-Id: Iad3de6582c522b75856421078a704bdf2e17c572
Signed-off-by: carey.xu <carey.xuhan@huawei.com>
(cherry picked from commit c1503ab8f0d9772effb562947bc67b860588e0d4)
Diffstat (limited to 'deploy')
-rw-r--r-- | deploy/client.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/deploy/client.py b/deploy/client.py index 0d51ce20..593f9033 100644 --- a/deploy/client.py +++ b/deploy/client.py @@ -852,23 +852,13 @@ class CompassClient(object): def get_installing_progress(self, cluster_id): def _get_installing_progress(): """get intalling progress.""" - action_timeout = time.time() + 60 * float(CONF.action_timeout) - deployment_timeout = time.time() + 60 * float( - CONF.deployment_timeout) - + deployment_timeout = time.time() + 60 * float(CONF.deployment_timeout) current_time = time.time while current_time() < deployment_timeout: status, cluster_state = self.get_cluster_state(cluster_id) if not self.is_ok(status): raise RuntimeError("can not get cluster state") - if cluster_state['state'] in ['UNINITIALIZED', 'INITIALIZED']: - if current_time() >= action_timeout: - raise RuntimeError("installation timeout") - else: - time.sleep(5) - continue - elif cluster_state['state'] == 'SUCCESSFUL': LOG.info( 'get cluster %s state status %s: %s, successful', @@ -880,6 +870,14 @@ class CompassClient(object): 'get cluster %s state status %s: %s, error', (cluster_id, status, cluster_state) ) + + LOG.info("current_time=%s, deployment_timeout=%s" \ + % (current_time(), deployment_timeout)) + time.sleep(5) + + if not current_time() < deployment_timeout: + raise RuntimeError("installation timeout") + try: _get_installing_progress() finally: |