diff options
author | huangxiangyu <huangxiangyu5@huawei.com> | 2017-06-20 20:42:07 +0800 |
---|---|---|
committer | Harry Huang <huangxiangyu5@huawei.com> | 2017-07-13 02:25:12 +0000 |
commit | 9d91215c859c5ebad4ba94e9c321f28ddb7b0316 (patch) | |
tree | 90fffeafeb6345f1556e3c499ac052e44ea68e9d /deploy/client.py | |
parent | a0edd1b2b4d4df6fc5c3e773eba66224930fdb46 (diff) |
Modify deploy/client.py
Bug:
1. when ansible_print process encounter runtime error
e.g. ansible.log doesn't exist, whole client.py
process stucks.
2. cobbler status encounters error when deploy timeout
happens.
Solution:
1. add ansible_print process alive check in function
get_installing_progress to exit parent process
when child process encounter runtime error.
2. remove unnecessary code in calling cobbler status
which cause error.
Change-Id: Ie04d45fd612e7273a6d584e3efb69e1506cdd0f9
Signed-off-by: huangxiangyu <huangxiangyu5@huawei.com>
Diffstat (limited to 'deploy/client.py')
-rw-r--r-- | deploy/client.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/deploy/client.py b/deploy/client.py index 6d5daa38..366ae418 100644 --- a/deploy/client.py +++ b/deploy/client.py @@ -952,6 +952,9 @@ class CompassClient(object): deployment_timeout = time.time() + 60 * float(CONF.deployment_timeout) # noqa current_time = time.time while current_time() < deployment_timeout: + if not ansible_print.is_alive(): + raise RuntimeError("can not get ansible log") + status, cluster_state = self.get_cluster_state(cluster_id) if not self.is_ok(status): raise RuntimeError("can not get cluster state") @@ -975,7 +978,7 @@ class CompassClient(object): % (current_time(), deployment_timeout)) LOG.info("cobbler status:") os.system("sudo docker exec compass-cobbler bash -c \ - 'cobbler status'" % (CONF.rsa_file)) + 'cobbler status'") raise RuntimeError("installation timeout") try: |