File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -62,13 +62,17 @@ def __init__(self, **kwargs):
6262 super (SLURMPlugin , self ).__init__ (self ._template , ** kwargs )
6363
6464 def _is_pending (self , taskid ):
65- # subprocess.Popen requires taskid to be a string
66- res = CommandLine (
67- 'squeue' ,
68- args = ' ' .join (['-j' , '%s' % taskid ]),
69- resource_monitor = False ,
70- terminal_output = 'allatonce' ).run ()
71- return res .runtime .stdout .find (str (taskid )) > - 1
65+ try :
66+ res = CommandLine (
67+ 'squeue' ,
68+ args = ' ' .join (['-j' , '%s' % taskid ]),
69+ resource_monitor = False ,
70+ terminal_output = 'allatonce' ).run ()
71+ return res .runtime .stdout .find (str (taskid )) > - 1
72+ except RuntimeError as e :
73+ if 'Invalid job id' not in str (e ):
74+ raise (e )
75+ return False
7276
7377 def _submit_batchtask (self , scriptfile , node ):
7478 """
You can’t perform that action at this time.
0 commit comments