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

chore(deepsource): update docstrings for public functions

This commit is contained in:
Gavin D'souza 2020-03-26 13:09:23 +05:30
parent d51311b7f7
commit af8f74db46
3 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,7 @@ from bench.utils import CommandFailedError, exec_cmd, fix_prod_setup_perms, get_
def setup_production_prerequisites():
"""Installs ansible, fail2banc, NGINX and supervisor"""
if not find_executable("ansible"):
exec_cmd("sudo {0} -m pip install ansible".format(sys.executable))
if not find_executable("fail2ban-client"):

View File

@ -14,6 +14,7 @@ from six.moves import configparser
def generate_supervisor_config(bench_path, user=None, yes=False):
"""Generate supervisor config for respective bench path"""
if not user:
user = getpass.getuser()
@ -55,6 +56,7 @@ def generate_supervisor_config(bench_path, user=None, yes=False):
def get_supervisord_conf():
"""Returns path of supervisord config from possible paths"""
possibilities = ("supervisord.conf", "etc/supervisord.conf", "/etc/supervisord.conf", "/etc/supervisor/supervisord.conf", "/etc/supervisord.conf")
for possibility in possibilities:

View File

@ -11,6 +11,7 @@ from bench.utils import exec_cmd, get_bench_name, get_cmd_output
def is_sudoers_set():
"""Check if bench sudoers is set"""
cmd = ["sudo", "-n", "bench"]
with open(os.devnull, "wb") as f:
@ -28,6 +29,7 @@ def is_sudoers_set():
def is_production_set(bench_path):
"""Check if production is set for current bench"""
production_setup = False
bench_name = get_bench_name(bench_path)
@ -47,6 +49,7 @@ def is_production_set(bench_path):
def execute(bench_path):
"""This patch checks if bench sudoers is set and regenerate supervisor and sudoers files"""
user = get_config('.').get("frappe_user") or getpass.getuser()
if is_sudoers_set():