2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

fix sudoers, add user argument

This commit is contained in:
Pratik Vyas 2014-09-03 12:05:23 +05:30
parent c989a974b5
commit a509d339cf
2 changed files with 5 additions and 4 deletions

View File

@ -157,9 +157,10 @@ def setup():
pass
@click.command('sudoers')
def setup_sudoers():
@click.argument('user')
def setup_sudoers(user):
"Add commands to sudoers list for execution without password"
_setup_sudoers()
_setup_sudoers(user)
@click.command('nginx')
def setup_nginx():

View File

@ -122,10 +122,10 @@ def update_bench():
cwd = os.path.dirname(os.path.abspath(__file__))
exec_cmd("git pull", cwd=cwd)
def setup_sudoers():
def setup_sudoers(user):
with open('/etc/sudoers.d/frappe', 'w') as f:
f.write("{user} ALL=(ALL) NOPASSWD: {supervisorctl} restart frappe\:\n".format(
user=getpass.getuser(),
user=user,
supervisorctl=subprocess.check_output('which supervisorctl', shell=True).strip()))
def setup_logging(bench='.'):