]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
If a YAML error is hit, log the raw object 268/head
authorZack Cerza <zack@redhat.com>
Mon, 18 Jul 2016 22:50:01 +0000 (16:50 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 18 Jul 2016 22:50:01 +0000 (16:50 -0600)
We are seeing: "RepresenterError: cannot represent an object: pcp"

Signed-off-by: Zack Cerza <zack@redhat.com>
callback_plugins/failure_log.py

index e0c622382d9201ccf8742469bebe4e4a715bbafd..3bcdb395afe6bf8a1f7e95f6c8fcff93a1645d3a 100644 (file)
@@ -40,7 +40,10 @@ def log_failure(host, result):
         failure[host] = result
         if ANSIBLE_MAJOR >= 2:
             failure = sanitize_dict(failure)
-        log.error(yaml.safe_dump(failure))
+        try:
+            log.error(yaml.safe_dump(failure))
+        except Exception:
+            log.exception("Failure object was: %s", str(failure))
 
 
 def sanitize_dict(obj):