- logger.console('Virtualenv setup including requirements.txt on {0}'
- .format(node['host']))
- ssh = SSH()
- ssh.connect(node)
- (ret_code, _, _) = ssh.exec_command(
- 'cd {0} && rm -rf env && '
- 'virtualenv --system-site-packages --never-download env && '
- '. env/bin/activate && '
- 'pip install -r requirements.txt'
- .format(con.REMOTE_FW_DIR), timeout=100)
- if ret_code != 0:
- raise RuntimeError('Virtualenv setup including requirements.txt on {0}'
- .format(node['host']))
-
- logger.console('Virtualenv on {0} created'.format(node['host']))
-
-
-def setup_node(node, tarball, remote_tarball, results=None):
+ logger.console(
+ f"Virtualenv setup including requirements.txt on {node[u'type']} "
+ f"host {node[u'host']}, port {node[u'port']} starts."
+ )
+ cmd = f"cd {con.REMOTE_FW_DIR} && rm -rf env && virtualenv " \
+ f"-p $(which python3) --system-site-packages --never-download env " \
+ f"&& source env/bin/activate && ANSIBLE_SKIP_CONFLICT_CHECK=1 " \
+ f"pip3 install -r requirements.txt"
+ stdout, stderr = exec_cmd_no_error(
+ node, cmd, timeout=300, include_reason=True, export=False,
+ message=f"Failed install at node {node[u'type']} host {node[u'host']}, "
+ f"port {node[u'port']}"
+ )
+ logger.console(
+ f"Virtualenv setup on {node[u'type']} host {node[u'host']}, "
+ f"port {node[u'port']} done."
+ )
+ return stdout, stderr
+
+
+def setup_node(node, tarball, remote_tarball, results=None, logs=None):