From 8b5a1b70281e99480f397373f992689ba979058b Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 23 Mar 2016 23:37:56 +0530 Subject: [PATCH] [fix] supervisor restart backward compatibility --- bench/utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bench/utils.py b/bench/utils.py index 4f5d8712..f4d869f7 100644 --- a/bench/utils.py +++ b/bench/utils.py @@ -264,7 +264,15 @@ def restart_supervisor_processes(bench='.'): bench_name = get_bench_name(bench) cmd = conf.get('supervisor_restart_cmd', 'sudo supervisorctl restart {bench_name}-processes:'.format(bench_name=bench_name)) - exec_cmd(cmd, cwd=bench) + + try: + exec_cmd(cmd, cwd=bench) + except CommandFailedError: + if cmd.endswith('{bench_name}-processes:'.format(bench_name=bench_name)): + # backward compatibility + exec_cmd('sudo supervisorctl restart frappe:', cwd=bench) + else: + raise def get_site_config(site, bench='.'): config_path = os.path.join(bench, 'sites', site, 'site_config.json')