瀏覽代碼

failure_summary: make sure msg is always a string

Some tasks may return a dict in the msg. In that case `stringc` will
fail to colorize it (with "AttributeError: <msg type> object has no
attribute 'split'" error.
Vadim Rutkovsky 7 年之前
父節點
當前提交
6d15313473
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      roles/openshift_health_checker/callback_plugins/zz_failure_summary.py

+ 2 - 0
roles/openshift_health_checker/callback_plugins/zz_failure_summary.py

@@ -175,6 +175,8 @@ def format_failure(failure):
     play = failure['play']
     task = failure['task']
     msg = failure['msg']
+    if not isinstance(msg, string_types):
+        msg = str(msg)
     checks = failure['checks']
     fields = (
         (u'Hosts', host),