From 1d13e0b2391542201551f97773fcb559bf661d8c Mon Sep 17 00:00:00 2001 From: xudan Date: Wed, 7 Jun 2017 02:23:21 -0400 Subject: Docker version misalignment and move some irrelevant messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JIRA: DOVETAIL-437 JIRA: DOVETAIL-444 1. Docker client version and server version should be 1.12.3 or later. 2. If any of them is older than 1.12.3, there will be an ERROR message. 3. Delete the “rm -rf results” message. Change-Id: I0c10cf256ef139cac4d43f36108bf5f3f9da8398 Signed-off-by: xudan --- dovetail/run.py | 2 +- dovetail/utils/dovetail_utils.py | 35 ++++++++++++++--------------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/dovetail/run.py b/dovetail/run.py index 84bd88f3..406b6d37 100755 --- a/dovetail/run.py +++ b/dovetail/run.py @@ -173,7 +173,7 @@ def clean_results_dir(): if os.path.exists(result_path): if os.path.isdir(result_path): cmd = 'sudo rm -rf %s/*' % (result_path) - dt_utils.exec_cmd(cmd, exit_on_error=False) + dt_utils.exec_cmd(cmd, exit_on_error=False, exec_msg_on=False) else: print "result_dir in dovetail_config.yml is not a directory." raise SystemExit(1) diff --git a/dovetail/utils/dovetail_utils.py b/dovetail/utils/dovetail_utils.py index e6a775f1..f81ddef2 100644 --- a/dovetail/utils/dovetail_utils.py +++ b/dovetail/utils/dovetail_utils.py @@ -171,24 +171,17 @@ def show_progress_bar(length): def check_docker_version(logger=None): - ret, server_ver = exec_cmd("sudo docker version -f'{{.Server.Version}}'", - logger=logger) - ret, client_ver = exec_cmd("sudo docker version -f'{{.Client.Version}}'", - logger=logger) - logger.info("\ndocker version: \nclient:%s\nserver:%s", client_ver, - server_ver) - if(LooseVersion(client_ver) <= LooseVersion('1.8.0') or - LooseVersion(server_ver) <= LooseVersion('1.8.0')): - logger.warn("\n\nDocker version is too old, may cause unpredictable " - "errors, you can update or install the lastest docker " - "for both host and container as below:\nwget -qO- " - "https://get.docker.com/ | sh\n\nClient:%s\nServer:%s", - client_ver, server_ver) - exit(-1) - - if(client_ver != server_ver): - logger.warn("\n\nVersion mismatch, may cause unpredictable " - "errors, you can update or install the lastest " - "docker for both host and container as below:\nwget " - "-qO- https://get.docker.com/ | " - "sh\n\nClient:%s\nServer:%s", client_ver, server_ver) + server_ret, server_ver = \ + exec_cmd("sudo docker version -f'{{.Server.Version}}'", logger=logger) + client_ret, client_ver = \ + exec_cmd("sudo docker version -f'{{.Client.Version}}'", logger=logger) + if server_ret == 0: + logger.debug("docker server version: %s", server_ver) + if server_ret != 0 or (LooseVersion(server_ver) < LooseVersion('1.12.3')): + logger.error("Don't support this Docker server version. " + "Docker server should be updated to at least 1.12.3.") + if client_ret == 0: + logger.debug("docker client version: %s", client_ver) + if client_ret != 0 or (LooseVersion(client_ver) < LooseVersion('1.12.3')): + logger.error("Don't support this Docker client version. " + "Docker client should be updated to at least 1.12.3.") -- cgit 1.2.3-korg