From 71af7320f29f52c43c284ef6ce92b6c7ec17e38d Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 15 Jan 2020 13:36:32 +0530 Subject: [PATCH] fix: ansible install on versioned pip --- bench/commands/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bench/commands/setup.py b/bench/commands/setup.py index bb59a857..c027c0c4 100755 --- a/bench/commands/setup.py +++ b/bench/commands/setup.py @@ -1,4 +1,5 @@ from bench.utils import exec_cmd +from six import PY3 import click, sys, json import os @@ -57,7 +58,7 @@ def setup_production(user, yes=False): # Install prereqs for production from distutils.spawn import find_executable if not find_executable('ansible'): - exec_cmd("sudo pip install ansible") + exec_cmd("sudo {0} install ansible".format("pip3" if PY3 else "pip2")) if not find_executable('fail2ban-client'): exec_cmd("bench setup role fail2ban") if not find_executable('nginx'):