@@ -135,7 +135,7 @@ def run(self, args, env):
135135 def error (msg ):
136136 # fall through (exception and else case are handled the same way)
137137 sys .stdout .write ('%s\n ' % msg )
138- return (502 , {'error' : 'The action did not return a dictionary.' })
138+ return (502 , {'error' : 'The action did not return a dictionary or array .' })
139139
140140 try :
141141 input = json .dumps (args )
@@ -186,7 +186,7 @@ def error(msg):
186186
187187 try :
188188 json_output = json .loads (lastLine )
189- if isinstance (json_output , dict ):
189+ if isinstance (json_output , dict ) or isinstance ( json_output , list ) :
190190 return (200 , json_output )
191191 else :
192192 return error (lastLine )
@@ -258,7 +258,7 @@ def init(message=None):
258258
259259def run (message = None ):
260260 def error ():
261- response = flask .jsonify ({'error' : 'The action did not receive a dictionary as an argument.' })
261+ response = flask .jsonify ({'error' : 'The action did not receive a dictionary or array as an argument.' })
262262 response .status_code = 404
263263 return complete (response )
264264
@@ -269,7 +269,7 @@ def error():
269269 return error ()
270270 else :
271271 args = message .get ('value' , {}) if message else {}
272- if not isinstance (args , dict ):
272+ if not ( isinstance (args , dict ) or isinstance ( args , list ) ):
273273 return error ()
274274
275275 if runner .verify ():
0 commit comments