You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/03/05 00:22:58 UTC

[trafficserver] 08/14: more clean up to bootstrap.py

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit a79347d85c4168511de8cb52f1108dc44d5e4c5f
Author: Jason <dr...@live.com>
AuthorDate: Fri Feb 24 15:51:39 2017 -0600

    more clean up to bootstrap.py
---
 tests/bootstrap.py | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/tests/bootstrap.py b/tests/bootstrap.py
index 480a90b..7980928 100755
--- a/tests/bootstrap.py
+++ b/tests/bootstrap.py
@@ -160,25 +160,22 @@ def gen_package_cmds(packages):
     return ret
 
 
+extra=''
+if distro() == 'RHEL' or distro() == 'CentOS':
+    extra = ". /opt/rh/rh-python35/enable ;"
+
 def venv_cmds(path):
     '''
     Create virtual environment and add it
     to the path being used for the script
     '''
 
-    if isRedHatBased():
-        ret = [
-            # first command only needed for rhel and centos systems at this time
-            ". /opt/rh/rh-python35/enable || true ; virtualenv --python=python3 {0}".format(path),
-            ". /opt/rh/rh-python35/enable || true ; {0}/bin/pip install pip --upgrade".format(path)
-        ]
-    else:
-        ret = [
-            # first command only needed for rhel and centos systems at this time
-            "virtualenv --python=python3 {0}".format(path),
-            "{0}/bin/pip install pip --upgrade".format(path)
-        ]
-    return ret
+    return = [
+        # first command only needed for rhel and centos systems at this time
+        extra + " virtualenv --python=python3 {0}".format(path),
+        extra +" {0}/bin/pip install pip --upgrade".format(path)
+    ]
+    
 
 
 def main():
@@ -224,12 +221,8 @@ def main():
         cmds += venv_cmds(args.venv_path)
         if path_to_pip is None:
             path_to_pip = os.path.join(args.venv_path, "bin", args.use_pip)
-
-    # install pip packages
-    if isRedHatBased():
-        cmds += [". /opt/rh/rh-python35/enable || true ;{0} install {1}".format(path_to_pip, " ".join(pip_packages))]
-    else:
-        cmds += ["{0} install {1}".format(path_to_pip, " ".join(pip_packages))]
+    
+    cmds += [extra + "{0} install {1}".format(path_to_pip, " ".join(pip_packages))]
 
     run_cmds(cmds)
 

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.