Fix incorrect msg in the results dict in loops (#71482)

pull/71500/head
Martin Krizek 4 years ago committed by GitHub
parent a1a624b150
commit 50f221c63e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- Fix incorrect msg in the results dict in loops

@ -145,7 +145,7 @@ class TaskExecutor:
res[array] = res[array] + item[array]
del item[array]
if not res.get('Failed', False):
if not res.get('failed', False):
res['msg'] = 'All items completed'
else:
res = dict(changed=False, skipped=True, skipped_reason='No items in the list', results=[])

@ -33,7 +33,7 @@ ok: [testhost] => (item=debug-3) => {
"msg": "debug-3"
}
skipping: [testhost] => (item=debug-4)
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
...ignoring
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************

@ -1,5 +1,5 @@
+ ansible-playbook -i inventory test.yml
++ set +x
fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"}
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"}

@ -27,7 +27,7 @@ failed: [testhost] (item=debug-2) => {
"msg": "debug-2"
}
skipping: [testhost] => (item=debug-4)
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
...ignoring
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************

@ -29,7 +29,7 @@ failed: [testhost] (item=debug-2) => {
ok: [testhost] => (item=debug-3) => {
"msg": "debug-3"
}
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
...ignoring
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************

@ -23,7 +23,7 @@ changed: [testhost] => (item=debug-1) => {
failed: [testhost] (item=debug-2) => {
"msg": "debug-2"
}
fatal: [testhost]: FAILED! => {"msg": "All items completed"}
fatal: [testhost]: FAILED! => {"msg": "One or more items failed"}
...ignoring
TASK [EXPECTED FAILURE Failed task to be rescued] ******************************

Loading…
Cancel
Save