Python3: PIP requirement
[csit.git] / resources / libraries / python / SetupFramework.py
index a1e4e7a..3f74057 100644 (file)
@@ -54,7 +54,7 @@ def pack_framework_dir():
 
     run(["tar", "--sparse", "--exclude-vcs", "--exclude=output*.xml",
          "--exclude=./tmp", "-zcf", file_name, "."],
-        check=True, msg="Could not pack testing framework")
+        msg="Could not pack testing framework")
 
     return file_name
 
@@ -111,8 +111,9 @@ def create_env_directory_at_node(node):
                    .format(host))
     exec_cmd_no_error(
         node, 'cd {0} && rm -rf env'
-        ' && virtualenv --system-site-packages --never-download env'
-        ' && source env/bin/activate && pip install -r requirements.txt'
+        ' && virtualenv -p $(which python3) '
+        '--system-site-packages --never-download env'
+        ' && source env/bin/activate && pip3 install -r requirements.txt'
         .format(con.REMOTE_FW_DIR), timeout=100, include_reason=True,
         message="Failed install at node {host}".format(host=host))
     logger.console('Virtualenv setup on {0} done.'.format(host))
@@ -143,7 +144,7 @@ def setup_node(node, tarball, remote_tarball, results=None):
             node=host, err=exc))
         result = False
     else:
-        logger.console('Setup of node {0} done.'.format(host))
+        logger.console('Setup of node {ip} done.'.format(ip=host))
         result = True
 
     if isinstance(results, list):
@@ -246,6 +247,9 @@ class SetupFramework(object):
         delete_local_tarball(tarball)
         if all(results):
             logger.console('All nodes are ready.')
+            for node in nodes.values():
+                logger.info('Setup of {type} node {ip} done.'.
+                            format(type=node['type'], ip=node['host']))
         else:
             raise RuntimeError('Failed to setup framework.')