Commit 40a59c34 authored by Boxiang Sun's avatar Boxiang Sun

list all not running on-watch service

parent 1b479ee7
...@@ -893,16 +893,19 @@ class Partition(object): ...@@ -893,16 +893,19 @@ class Partition(object):
print(service_list) print(service_list)
has_failed_on_watch_process = False bad_service_list = []
with self.getSupervisorRPC() as supervisor: with self.getSupervisorRPC() as supervisor:
all_process = supervisor.getAllProcessInfo() all_process = supervisor.getAllProcessInfo()
print(all_process) print(all_process)
for process in all_process: for process in all_process:
if 'on-watch' in process['name'] and process['statename'] != "RUNNING": if 'on-watch' in process['name'] and process['statename'] != "RUNNING":
self.logger.info('On watch service %r is not running' % process['name']) self.logger.info('On watch service %r is not running' % process['name'])
has_failed_on_watch_process = True bad_service_list.append(process['name'])
if has_failed_on_watch_process: if len(bad_service_list) > 0:
raise ChildProcessError("Some on-watch process is not running, please check the log.") raise ChildProcessError(
"The following on-watch service(es) is not running, \
for the details, please check the corresponding log: %s",
'\n'.join(bad_service_list))
def cleanupFolder(self, folder_path): def cleanupFolder(self, folder_path):
"""Delete all files and folders in a specified directory """Delete all files and folders in a specified directory
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment