summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhongbo tian <hongbo.tianhongbo@huawei.com>2016-11-15 08:45:06 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-11-15 08:45:06 +0000
commit64b221bee631cf52bf6a1109c16f9544eff58f80 (patch)
tree009e8da5da47f02972c6f7a4323148d8def42dfe
parente55f135b58fa463af7a9a49e40d9b9d554fdb799 (diff)
parentd2a1c76600a358397fef02d13726916390c2b2f1 (diff)
Merge "dovetail tool: reorganize prepare_env.py"
-rw-r--r--dovetail/prepare_env.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/dovetail/prepare_env.py b/dovetail/prepare_env.py
index 7573fb6e..9cf0f4f0 100644
--- a/dovetail/prepare_env.py
+++ b/dovetail/prepare_env.py
@@ -8,6 +8,7 @@
#
import platform
+
import utils.dovetail_logger as dt_logger
import utils.dovetail_utils as dt_utils
@@ -48,12 +49,19 @@ def get_docker_pkgname(os):
else:
return None
-logger = dt_logger.Logger('prepare_env.py').getLogger()
-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)
+def main():
+ """Dovetail prepare env main"""
+ logger = dt_logger.Logger('prepare_env.py').getLogger()
+
+ 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)
+
+ cmd = "sudo pip install click pyyaml jinja2"
+ dt_utils.exec_cmd(cmd, logger)
+
-cmd = "sudo pip install click pyyaml jinja2"
-dt_utils.exec_cmd(cmd, logger)
+if __name__ == '__main__':
+ main()