2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-24 07:28:25 +00:00

Handle python3 version for centos

This commit is contained in:
Ameya Shenoy 2018-03-26 16:55:31 +05:30
parent 97d81b0ba4
commit 1eed28eade
No known key found for this signature in database
GPG Key ID: 735490161CD5C91E
2 changed files with 14 additions and 1 deletions

View File

@ -82,6 +82,14 @@ def install_bench(args):
if args.user == 'root':
raise Exception('Please run this script as a non-root user with sudo privileges, but without using sudo or pass --user=USER')
# Python executable
if not args.production:
dist_name, dist_version = get_distribution_info()
if dist_name is 'centos':
args.python = 'python3.6'
else:
args.python = 'python3'
# create user if not exists
extra_vars = vars(args)
extra_vars.update(frappe_user=args.user)
@ -371,6 +379,11 @@ def parse_commandline_args():
parser.add_argument('--admin-password', dest='admin_password', help='Set admin password')
parser.add_argument('--bench-name', dest='bench_name', help='Create bench with specified name. Default name is frappe-bench')
# Python interpreter to be used
parser.add_argument('--python', dest='python', default='python',
help=argparse.SUPPRESS
)
args = parser.parse_args()
return args

View File

@ -29,7 +29,7 @@
register: bench_stat
- name: python3 bench init for develop
command: bench init {{ bench_path }} --frappe-branch {{ branch }} --python python3
command: bench init {{ bench_path }} --frappe-branch {{ branch }} --python {{ python }}
args:
creates: "{{ bench_path }}"
when: not bench_stat.stat.exists and not production