summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--playbooks/zuul-stream/fixtures/test-stream.yaml7
-rw-r--r--zuul/ansible/callback/zuul_stream.py14
2 files changed, 17 insertions, 4 deletions
diff --git a/playbooks/zuul-stream/fixtures/test-stream.yaml b/playbooks/zuul-stream/fixtures/test-stream.yaml
index 5bffc16ce..29bbf4759 100644
--- a/playbooks/zuul-stream/fixtures/test-stream.yaml
+++ b/playbooks/zuul-stream/fixtures/test-stream.yaml
@@ -20,6 +20,13 @@
- item2
- item3
+ - name: Loop with complex items
+ command: "echo {{ item.name }}"
+ with_items:
+ - name: complex1
+ - name: complex2
+ - name: complex3
+
- name: Run a shell task with an ansible python exception
command: echo foo
args:
diff --git a/zuul/ansible/callback/zuul_stream.py b/zuul/ansible/callback/zuul_stream.py
index 9a7a92599..906f05217 100644
--- a/zuul/ansible/callback/zuul_stream.py
+++ b/zuul/ansible/callback/zuul_stream.py
@@ -428,10 +428,16 @@ class CallbackModule(default.CallbackModule):
indent=2, sort_keys=True),
status=status)
else:
- self._log_message(
- result,
- "Item: {item} Runtime: {delta}"
- " Start: {start} End: {end}".format(**result_dict))
+ if isinstance(result_dict['item'], str):
+ self._log_message(
+ result,
+ "Item: {item} Runtime: {delta}"
+ " Start: {start} End: {end}".format(**result_dict))
+ else:
+ self._log_message(
+ result,
+ "Item: Runtime: {delta} Start: {start} End: {end}".format(
+ **result_dict))
if self._deferred_result:
self._process_deferred(result)