diff options
-rwxr-xr-x | dovetail/run.py | 2 | ||||
-rw-r--r-- | 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.") |