dovetail tool: delete unnecessary prepare_env.py 99/26999/2
authorMatthewLi <matthew.lijun@huawei.com>
Sat, 14 Jan 2017 06:26:00 +0000 (01:26 -0500)
committerMatthewLi <matthew.lijun@huawei.com>
Mon, 16 Jan 2017 03:02:39 +0000 (22:02 -0500)
JIRA: DOVETAIL-181

Change-Id: I6e79467b829b4ae1d815bdb9ead0b930f0338cd2
Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
docs/dovetailtool/dovetail.tool.installation.rst
dovetail/prepare_env.py [deleted file]

index 288de0b..24717fb 100644 (file)
@@ -56,34 +56,41 @@ Dovetail configuration:
 To modify the ``envs`` parameters, e.g., SUT_TYPE, SUT_IP, NODE_NAME,
 DEPLOY_SCENARIO, BUILD_TAG, CI_DEBUG, DEPLOY_TYPE, in the yml files.
 
-System dependencies are installed via the ``prepare_env.py`` file, and you will need ``sudo``
-access to complete the installation.
+System dependencies and project configuration information are listed in
+``requirements.txt``, ``setup.py`` and ``setup.cfg``, in Ubuntu environment,
+to run
 
 ::
 
-  cd {dovetail_path}/dovetail/dovetail
-  python prepare_env.py
+  apt-get -y install python-pip
+  pip install .
 
-At this point the environment is now ready for Dovetail execution.
+in ``centos`` and ``redhat`` environment, to run
+
+::
+
+  yum -y install python-pip
+  pip install .
+
+in ``fedora`` environment, to run
 
-The tool ``tox`` is used, environment preparation progress is included in tox
-until completely replaced, the configuration information is set in:
 
 ::
 
-  setup.py
-  setup.cfg
-  requirements.txt
-  test-requirements.txt
+  dnf -y install python-pip
+  pip install .
+
+then the setup requirements are installed and **dovetail** commmand-line can be used,
+by using ``dovetail --help``, **dovetail** command-line details are shown.
 
+The tool ``tox`` is used, which configuration information is defined in
+``tox.ini``, unitttest, flake8-checking, coverage check, etc, can be done
 by running:
 
 ::
 
   tox
 
-the environment prepartion is completed.
-
 Compliance and certification test cases
 ----------------------------------------
 
diff --git a/dovetail/prepare_env.py b/dovetail/prepare_env.py
deleted file mode 100644 (file)
index 3ddf75b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python
-#
-# grakiss.wanglei@huawei.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-
-import platform
-
-import utils.dovetail_utils as dt_utils
-
-
-def get_os_lower():
-    """Get distro name.
-
-    :returns: return distro name as a string
-    """
-    platform_os = platform.dist()[0]
-    return platform_os.lower()
-
-
-def get_install_bin(os):
-    """Get install command binary.
-
-    :returns: return install command according to distro
-    """
-    if os in ['centos', 'redhat']:
-        return 'yum'
-    elif os == 'fedora':
-        return 'dnf'
-    elif os == 'ubuntu':
-        return 'apt-get'
-    else:
-        return None
-
-
-def get_docker_pkgname(os):
-    """Get docker package name.
-
-    :returns: return docker package name according to distro
-    """
-    if os in ['centos', 'fedora', 'redhat']:
-        return 'docker'
-    elif os == 'ubuntu':
-        return 'docker.io'
-    else:
-        return None
-
-
-def main():
-    """Dovetail prepare env main"""
-
-    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)
-
-    cmd = "sudo pip install click pyyaml jinja2"
-    dt_utils.exec_cmd(cmd)
-
-
-if __name__ == '__main__':
-    main()