@@ -153,8 +153,8 @@ def next_seg(remain, obj): # type: (Text, Any) -> Any
153
153
return obj
154
154
155
155
156
- def evaluator (ex , jslib , obj , fullJS = False , timeout = None , debug = False ):
157
- # type: (Text, Text, Dict[Text, Any], bool, int, bool) -> JSON
156
+ def evaluator (ex , jslib , obj , fullJS = False , timeout = None , strict_docker_pull = False , debug = False ):
157
+ # type: (Text, Text, Dict[Text, Any], bool, int, bool, bool ) -> JSON
158
158
m = param_re .match (ex )
159
159
if m :
160
160
if m .end (1 )+ 1 == len (ex ) and m .group (1 ) == "null" :
@@ -164,16 +164,17 @@ def evaluator(ex, jslib, obj, fullJS=False, timeout=None, debug=False):
164
164
except Exception as w :
165
165
raise WorkflowException ("%s%s" % (m .group (1 ), w ))
166
166
elif fullJS :
167
- return sandboxjs .execjs (ex , jslib , timeout = timeout , debug = debug )
167
+ return sandboxjs .execjs (ex , jslib , timeout = timeout , strict_docker_pull = strict_docker_pull , debug = debug )
168
168
else :
169
169
raise sandboxjs .JavascriptException (
170
170
"Syntax error in parameter reference '%s' or used Javascript code without specifying InlineJavascriptRequirement." ,
171
171
ex )
172
172
173
173
174
174
def interpolate (scan , rootvars ,
175
- timeout = None , fullJS = None , jslib = "" , debug = False ):
176
- # type: (Text, Dict[Text, Any], int, bool, Union[str, Text], bool) -> JSON
175
+ timeout = None , fullJS = None , jslib = "" ,strict_docker_pull = False ,
176
+ debug = False ):
177
+ # type: (Text, Dict[Text, Any], int, bool, Union[str, Text], bool, bool) -> JSON
177
178
scan = scan .strip ()
178
179
parts = []
179
180
w = scanner (scan )
@@ -182,7 +183,8 @@ def interpolate(scan, rootvars,
182
183
183
184
if scan [w [0 ]] == '$' :
184
185
e = evaluator (scan [w [0 ] + 1 :w [1 ]], jslib , rootvars , fullJS = fullJS ,
185
- timeout = timeout , debug = debug )
186
+ timeout = timeout , strict_docker_pull = strict_docker_pull ,
187
+ debug = debug )
186
188
if w [0 ] == 0 and w [1 ] == len (scan ):
187
189
return e
188
190
leaf = json .dumps (e , sort_keys = True )
@@ -200,8 +202,8 @@ def interpolate(scan, rootvars,
200
202
201
203
202
204
def do_eval (ex , jobinput , requirements , outdir , tmpdir , resources ,
203
- context = None , pull_image = True , timeout = None , debug = False ):
204
- # 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) -> Any
205
+ context = None , pull_image = True , timeout = None , strict_docker_pull = False , debug = 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 ) -> Any
205
207
206
208
runtime = copy .copy (resources )
207
209
runtime ["tmpdir" ] = docker_windows_path_adjust (tmpdir )
@@ -227,6 +229,7 @@ def do_eval(ex, jobinput, requirements, outdir, tmpdir, resources,
227
229
timeout = timeout ,
228
230
fullJS = fullJS ,
229
231
jslib = jslib ,
232
+ strict_docker_pull = strict_docker_pull ,
230
233
debug = debug )
231
234
except Exception as e :
232
235
raise WorkflowException ("Expression evaluation error:\n %s" % e )
0 commit comments