@@ -121,7 +121,12 @@ def call_cmd(self, cmd, cwd):
121121 f .write (str (cmd ))
122122 stdout = open (self .outfile , "w" )
123123 stderr = open (self .errfile , "w" )
124- logging .info ("Calling: %s, with outfile: %s and errfile: %s" , (" " .join (cmd )), self .outfile , self .errfile )
124+ logging .info (
125+ "Calling: %s, with outfile: %s and errfile: %s" ,
126+ (" " .join (cmd )),
127+ self .outfile ,
128+ self .errfile ,
129+ )
125130 process = subprocess .Popen (
126131 cmd , stdout = stdout , stderr = stderr , close_fds = True , cwd = cwd
127132 )
@@ -208,10 +213,10 @@ def run(self, request, tempdir, opts):
208213 wftype = request ["workflow_type" ].lower ().strip ()
209214 version = request ["workflow_type_version" ]
210215
211- if version != "v1.0 " and wftype == "cwl" :
216+ if wftype == "cwl " and version not in ( "v1.0" , "v1.1" , "v1.2" ) :
212217 raise RuntimeError (
213218 'workflow_type "cwl" requires '
214- '"workflow_type_version" to be "v1.0 ": ' + str (version )
219+ '"workflow_type_version" to be "v1.[012] ": ' + str (version )
215220 )
216221 if version != "2.7" and wftype == "py" :
217222 raise RuntimeError (
@@ -274,7 +279,12 @@ def getstate(self):
274279 logging .info ("Workflow " + self .run_id + ": EXECUTOR_ERROR" )
275280 open (self .staterrorfile , "a" ).close ()
276281 return "EXECUTOR_ERROR" , 255
277- if subprocess .run (["toil" , "status" , "--failIfNotComplete" , self .jobstorefile ]).returncode == 0 :
282+ if (
283+ subprocess .run (
284+ ["toil" , "status" , "--failIfNotComplete" , self .jobstorefile ]
285+ ).returncode
286+ == 0
287+ ):
278288 completed = True
279289 if completed :
280290 logging .info ("Workflow " + self .run_id + ": COMPLETE" )
@@ -296,7 +306,7 @@ class ToilBackend(WESBackend):
296306 def GetServiceInfo (self ):
297307 return {
298308 "workflow_type_versions" : {
299- "CWL" : {"workflow_type_version" : ["v1.0" ]},
309+ "CWL" : {"workflow_type_version" : ["v1.0" , "v1.1" , "v1.2" ]},
300310 "WDL" : {"workflow_type_version" : ["draft-2" ]},
301311 "PY" : {"workflow_type_version" : ["2.7" ]},
302312 },
0 commit comments