Commit a06b8474 authored by Boxiang Sun's avatar Boxiang Sun

list all the service info 2

parent a47f81db
......@@ -889,7 +889,7 @@ class Partition(object):
if os.path.exists(self.service_path):
if os.path.isdir(self.service_path):
for service in os.listdir(self.service_path):
service_list.append(service + '-on-watch')
service_list.append(service)
print(service_list)
......@@ -899,15 +899,17 @@ class Partition(object):
print(all_process)
for process in all_process:
if 'on-watch' in process['name'] and process['statename'] != "RUNNING":
for on_watch_service in service_list:
if service_list in process['name']:
self.logger.info('On watch service %r is not running' % process['name'])
bad_service_list.append(process['name'])
bad_service_list.append(process['name'] + '-on-watch')
if len(bad_service_list) > 0:
raise ChildProcessError(
"The following on-watch service(es) is not running:\n%s\n\
For the details, please check the corresponding log.\n\
The service path is: %s\n\
The services is: %s\n" %
('\n'.join(bad_service_list), self.service_path, str(os.listdir(self.service_path))))
('\n'.join(bad_service_list), self.service_path, str(service_list))))
def cleanupFolder(self, folder_path):
"""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