From d46a4ab8f5277fe47c98a54fb1a02d83264bb5bb Mon Sep 17 00:00:00 2001 From: MatthewLi Date: Mon, 7 Nov 2016 03:03:06 -0500 Subject: dovetail tool: os name bugfix JIRA: DOVETAIL-54 bug: in some envs, return value platform_os is Ubuntu rather than ubuntu. Change-Id: I6a2aa964d00eff9f336f8204071a05a6b5f11134 Signed-off-by: MatthewLi --- dovetail/prepare_env.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dovetail/prepare_env.py b/dovetail/prepare_env.py index 3e4d6964..7573fb6e 100644 --- a/dovetail/prepare_env.py +++ b/dovetail/prepare_env.py @@ -12,12 +12,13 @@ import utils.dovetail_logger as dt_logger import utils.dovetail_utils as dt_utils -def get_os(): +def get_os_lower(): """Get distro name. :returns: return distro name as a string """ - return platform.dist()[0] + platform_os = platform.dist()[0] + return platform_os.lower() def get_install_bin(os): @@ -49,7 +50,7 @@ def get_docker_pkgname(os): logger = dt_logger.Logger('prepare_env.py').getLogger() -os_name = get_os() +os_name = get_os_lower() cmd = "sudo %s -y install %s python-pip" \ % (get_install_bin(os_name), get_docker_pkgname(os_name)) dt_utils.exec_cmd(cmd, logger) -- cgit 1.2.3-korg