#NEWLINE# @ staticmethod #NEWLINE# def workerCleanup( info ) : #NEWLINE# #INDENT# '\n        Cleans up the worker node on batch system shutdown. Also see :meth:`supportsWorkerCleanup`.\n\n        :param WorkerCleanupInfo info: A named tuple consisting of all the relevant information\n               for cleaning up the worker.\n        ' #NEWLINE# assert isinstance ( info , WorkerCleanupInfo ) #NEWLINE# workflowDir = Toil . getWorkflowDir ( info . workflowID , info . workDir ) #NEWLINE# if ( ( workflowDir . cleanWorkDir == 'always' ) or ( ( info . cleanWorkDir in ( 'onSuccess' , 'onError' ) ) and ( os . listdir ( workflowDir ) == [ ] ) ) ) : #NEWLINE# #INDENT# shutil . rmtree ( workflowDir )