@@ -453,26 +453,31 @@ def get_cluster_for_server(server_name, aliases):
453453 return cluster_name
454454
455455
456- def list_restarts (model_context ):
456+ def list_restarts (model_context , exit_code ):
457457 """
458458 Get the list of restarts and save this list in format to restart.file
459459 in the -output_dirs location. If the output_dirs is not included, bypass
460460 writing to the restart file.
461461 :param model_context: instance of the tool model context
462+ :param exit_code: current exit code for online restarts
462463 """
463464 _method_name = 'list_restarts'
464465 _logger .entering (model_context .get_output_dir (), class_name = _class_name , method_name = _method_name )
465466 restart_list = get_list_of_restarts ()
466467 output_dirs = model_context .get_output_dir ()
467- if output_dirs is not None :
468+ result = exit_code
469+ if len (restart_list ) == 0 :
470+ result = 0
471+ elif output_dirs is not None :
468472 file_name = os .path .join (output_dirs , 'restart.file' )
469473 pw = FileUtils .getPrintWriter (file_name )
470474 for entry in restart_list :
471475 line = '%s:%s:%s:%s' % (entry [0 ], entry [1 ], entry [2 ], entry [3 ])
472476 _logger .finer ('WLSDPLY-09208' , line , class_name = _class_name , method_name = _method_name )
473477 pw .println (line )
474478 pw .close ()
475- _logger .exiting (class_name = _class_name , method_name = _method_name )
479+ _logger .exiting (class_name = _class_name , method_name = _method_name , result = result )
480+ return result
476481
477482
478483def get_list_of_restarts ():
0 commit comments