2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00

fix: run patches for current user

This commit is contained in:
Gavin D'souza 2020-03-16 12:25:55 +05:30
parent fe02844c69
commit 78dbdcb3f1
2 changed files with 12 additions and 4 deletions

View File

@ -69,10 +69,13 @@ def update_supervisord_conf(user):
supervisord_conf = get_supervisord_conf()
section = "unix_http_server"
if not supervisord_conf:
return
config = configparser.ConfigParser()
config.read(supervisord_conf)
config[section]["chmod"] = "0760"
config[section]["chown"] = user
config[section]["chown"] = "{user}:{user}".format(user=user)
with open(supervisord_conf, "w") as f:
config.write(f)

View File

@ -1,4 +1,5 @@
# imports - standard imports
import getpass
import os
import subprocess
@ -33,6 +34,10 @@ def is_production_set(bench_path):
def execute(bench_path):
if is_sudoers_set() or is_production_set(bench_path):
exec_cmd("sudo bench setup supervisor --yes")
exec_cmd("sudo bench setup sudoers")
user = getpass.getuser()
if is_sudoers_set():
exec_cmd("sudo bench setup sudoers {user}".format(user=user))
if is_production_set(bench_path):
exec_cmd("sudo bench setup supervisor --yes --user {user}".format(user=user))