Commit f38efdf1 authored by Boxiang Sun's avatar Boxiang Sun

fixup

parent f6d4fb66
...@@ -893,15 +893,16 @@ class Partition(object): ...@@ -893,15 +893,16 @@ class Partition(object):
print(service_list) print(service_list)
bad_service_list = [] has_failed_on_watch_process = False
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'])
bad_service_list.append(process['name']) has_failed_on_watch_process = True
return bad_service_list if has_failed_on_watch_process:
raise ChildProcessError("Some on-watch process is not running, please check the log.")
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
......
...@@ -1292,15 +1292,7 @@ stderr_logfile_backups=1 ...@@ -1292,15 +1292,7 @@ stderr_logfile_backups=1
if not self.force_stop: if not self.force_stop:
self._checkPromiseList(local_partition) self._checkPromiseList(local_partition)
computer_partition.started() computer_partition.started()
bad_service_list = local_partition.checkOnWatchServiceStatus() local_partition.checkOnWatchServiceStatus()
if len(bad_service_list) > 0:
self.logger.removeHandler(partition_file_handler)
for service in bad_service_list:
self.logger.info('On watch service %r is not running' % service)
self.logger.addHandler(partition_file_handler)
raise ChildProcessError("No RUNNING on-watch process founded.")
self._endInstallationTransaction(computer_partition) self._endInstallationTransaction(computer_partition)
elif computer_partition_state == COMPUTER_PARTITION_STOPPED_STATE: elif computer_partition_state == COMPUTER_PARTITION_STOPPED_STATE:
try: try:
...@@ -1498,6 +1490,11 @@ stderr_logfile_backups=1 ...@@ -1498,6 +1490,11 @@ stderr_logfile_backups=1
except slapos.slap.ResourceNotReady: except slapos.slap.ResourceNotReady:
return '(not ready)' return '(not ready)'
self.logger.info('---------------------------------')
self.logger.info('---------------------------------')
self.logger.info('---------------------------------')
self.logger.info('I want generate an output here!!!')
self.logger.info('Finished computer partitions.') self.logger.info('Finished computer partitions.')
self.logger.info('=' * 80) self.logger.info('=' * 80)
if process_error_partition_list: if process_error_partition_list:
...@@ -1548,11 +1545,21 @@ stderr_logfile_backups=1 ...@@ -1548,11 +1545,21 @@ stderr_logfile_backups=1
except slapos.slap.ResourceNotReady: except slapos.slap.ResourceNotReady:
return '(not ready)' return '(not ready)'
self.logger.info('---------------------------------')
self.logger.info('---------------------------------')
self.logger.info('---------------------------------')
self.logger.info('I want generate an output here!!!')
if promise_error_partition_list: if promise_error_partition_list:
self.logger.info('Finished computer partitions.') self.logger.info('Finished computer partitions.')
for partition, exc in promise_error_partition_list: for partition, exc in promise_error_partition_list:
self.logger.info(' %s[%s]: %s', partition.getId(), getPartitionType(partition), exc) self.logger.info(' %s[%s]: %s', partition.getId(), getPartitionType(partition), exc)
self.logger.info('=================================')
self.logger.info('=================================')
self.logger.info('=================================')
self.logger.info('I want generate an output here!!!')
# Return success value # Return success value
if not clean_run_promise: if not clean_run_promise:
return SLAPGRID_PROMISE_FAIL return SLAPGRID_PROMISE_FAIL
......
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