瀏覽代碼

HUE-980 [shell] Shell stops working after first timeout

Romain Rigaux 13 年之前
父節點
當前提交
27c912a
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      apps/shell/src/shell/views.py

+ 3 - 2
apps/shell/src/shell/views.py

@@ -113,8 +113,9 @@ def retrieve_output(request):
       SHELL_OUTPUT_LOGGER.info(log_format % log_args)
 
   for shell in result:
-    if 'output' in result[shell]:
-      result[shell]['output'] = remove_colors(result[shell]['output'])
+    shell = result[shell]
+    if isinstance(shell, dict) and 'output' in shell:
+      shell['output'] = remove_colors(shell['output'])
 
   return HttpResponse(simplejson.dumps(result), mimetype="application/json")