- host = node['host']
- logger.console('Virtualenv setup including requirements.txt on {0} starts.'
- .format(host))
- exec_cmd_no_error(
- node, 'cd {0} && rm -rf env'
- ' && 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))
+ 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=100, 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