Skip to content

Commit

Permalink
fix: use frappe_user from site_config and use getpass as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Mar 16, 2020
1 parent 2fe5cce commit a6f72c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bench/patches/v5/fix_user_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# imports - module imports
from bench.cli import change_uid_msg
from bench.config.production_setup import get_supervisor_confdir, is_centos7
from bench.config.common_site_config import get_config
from bench.utils import exec_cmd, get_bench_name, get_cmd_output


Expand Down Expand Up @@ -34,7 +35,7 @@ def is_production_set(bench_path):


def execute(bench_path):
user = getpass.getuser()
user = get_config('.').get("frappe_user") or getpass.getuser()

if is_sudoers_set():
exec_cmd("sudo bench setup sudoers {user}".format(user=user))
Expand Down

0 comments on commit a6f72c7

Please sign in to comment.