File tree 1 file changed +11
-7
lines changed
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):
62
62
super (SLURMPlugin , self ).__init__ (self ._template , ** kwargs )
63
63
64
64
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
72
76
73
77
def _submit_batchtask (self , scriptfile , node ):
74
78
"""
You can’t perform that action at this time.
0 commit comments