summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthewLi <matthew.lijun@huawei.com>2016-11-07 03:03:06 -0500
committerMatthewLi <matthew.lijun@huawei.com>2016-11-07 21:34:52 -0500
commitd46a4ab8f5277fe47c98a54fb1a02d83264bb5bb (patch)
treefd94df431c0a2e7dbe44452f737c2d577031abae
parent976d8e0640e478c79002f402bbe9996955c02629 (diff)
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 <matthew.lijun@huawei.com>
-rw-r--r--dovetail/prepare_env.py7
1 files 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)