@@ -173,9 +173,10 @@ def evaluator(ex, jslib, obj, fullJS=False, timeout=None, force_docker_pull=Fals
173
173
174
174
def interpolate (scan , rootvars ,
175
175
timeout = None , fullJS = None , jslib = "" , force_docker_pull = False ,
176
- debug = False , js_console = False ):
177
- # type: (Text, Dict[Text, Any], int, bool, Union[str, Text], bool, bool, bool) -> JSON
178
- scan = scan .strip ()
176
+ debug = False , js_console = False , strip_whitespace = True ):
177
+ # type: (Text, Dict[Text, Any], int, bool, Union[str, Text], bool, bool, bool, bool) -> JSON
178
+ if strip_whitespace :
179
+ scan = scan .strip ()
179
180
parts = []
180
181
w = scanner (scan )
181
182
while w :
@@ -202,8 +203,9 @@ def interpolate(scan, rootvars,
202
203
203
204
204
205
def do_eval (ex , jobinput , requirements , outdir , tmpdir , resources ,
205
- context = None , pull_image = True , timeout = None , force_docker_pull = False , debug = False , js_console = False ):
206
- # type: (Union[dict, AnyStr], Dict[Text, Union[Dict, List, Text]], List[Dict[Text, Any]], Text, Text, Dict[Text, Union[int, Text]], Any, bool, int, bool, bool, bool) -> Any
206
+ context = None , pull_image = True , timeout = None , force_docker_pull = False ,
207
+ debug = False , js_console = False , strip_whitespace = True ):
208
+ # type: (Union[dict, AnyStr], Dict[Text, Union[Dict, List, Text]], List[Dict[Text, Any]], Text, Text, Dict[Text, Union[int, Text]], Any, bool, int, bool, bool, bool, bool) -> Any
207
209
208
210
runtime = copy .copy (resources )
209
211
runtime ["tmpdir" ] = docker_windows_path_adjust (tmpdir )
@@ -231,7 +233,8 @@ def do_eval(ex, jobinput, requirements, outdir, tmpdir, resources,
231
233
jslib = jslib ,
232
234
force_docker_pull = force_docker_pull ,
233
235
debug = debug ,
234
- js_console = js_console )
236
+ js_console = js_console ,
237
+ strip_whitespace = strip_whitespace )
235
238
236
239
except Exception as e :
237
240
raise WorkflowException ("Expression evaluation error:\n %s" % e )
0 commit comments