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:
parent
fe02844c69
commit
78dbdcb3f1
@ -69,10 +69,13 @@ def update_supervisord_conf(user):
|
|||||||
supervisord_conf = get_supervisord_conf()
|
supervisord_conf = get_supervisord_conf()
|
||||||
section = "unix_http_server"
|
section = "unix_http_server"
|
||||||
|
|
||||||
|
if not supervisord_conf:
|
||||||
|
return
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(supervisord_conf)
|
config.read(supervisord_conf)
|
||||||
config[section]["chmod"] = "0760"
|
config[section]["chmod"] = "0760"
|
||||||
config[section]["chown"] = user
|
config[section]["chown"] = "{user}:{user}".format(user=user)
|
||||||
|
|
||||||
with open(supervisord_conf, "w") as f:
|
with open(supervisord_conf, "w") as f:
|
||||||
config.write(f)
|
config.write(f)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# imports - standard imports
|
# imports - standard imports
|
||||||
|
import getpass
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
@ -33,6 +34,10 @@ def is_production_set(bench_path):
|
|||||||
|
|
||||||
|
|
||||||
def execute(bench_path):
|
def execute(bench_path):
|
||||||
if is_sudoers_set() or is_production_set(bench_path):
|
user = getpass.getuser()
|
||||||
exec_cmd("sudo bench setup supervisor --yes")
|
|
||||||
exec_cmd("sudo bench setup sudoers")
|
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))
|
||||||
|
Loading…
Reference in New Issue
Block a user