mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 14:50:02 -07:00
Ensure exit_json returns failed = False
This is required for modules that may return a non-zero `rc` value for a successful run, similar to #24865 for Windows fixing **win_chocolatey**. We also disable the dependency on `rc` value only, even if `failed` was set. Adapted unit and integration tests to the new scheme. Updated raw, shell, script, expect to take `rc` into account.
This commit is contained in:
parent
1f78715848
commit
0e160d5c7e
17 changed files with 68 additions and 56 deletions
|
@ -157,11 +157,6 @@
|
|||
state=absent
|
||||
register: result
|
||||
|
||||
- name: assert state=absent with key_material
|
||||
assert:
|
||||
that:
|
||||
- '"failed" not in result'
|
||||
|
||||
# ============================================================
|
||||
- name: test state=present without key_material
|
||||
ec2_key:
|
||||
|
@ -177,7 +172,6 @@
|
|||
assert:
|
||||
that:
|
||||
- 'result.changed'
|
||||
- '"failed" not in result'
|
||||
- '"key" in result'
|
||||
- '"name" in result.key'
|
||||
- '"fingerprint" in result.key'
|
||||
|
@ -200,7 +194,6 @@
|
|||
assert:
|
||||
that:
|
||||
- 'result.changed'
|
||||
- '"failed" not in result'
|
||||
- '"key" in result'
|
||||
- 'result.key == None'
|
||||
|
||||
|
@ -220,7 +213,6 @@
|
|||
- name: assert state=present with key_material
|
||||
assert:
|
||||
that:
|
||||
- '"failed" not in result'
|
||||
- 'result.changed == True'
|
||||
- '"key" in result'
|
||||
- '"name" in result.key'
|
||||
|
@ -246,7 +238,6 @@
|
|||
assert:
|
||||
that:
|
||||
- 'result.changed'
|
||||
- '"failed" not in result'
|
||||
- '"key" in result'
|
||||
- 'result.key == None'
|
||||
|
||||
|
@ -324,7 +315,6 @@
|
|||
assert:
|
||||
that:
|
||||
- 'result.changed'
|
||||
- '"failed" not in result'
|
||||
- '"key" in result'
|
||||
- 'result.key == None'
|
||||
|
||||
|
@ -345,6 +335,5 @@
|
|||
assert:
|
||||
that:
|
||||
- 'not result.changed'
|
||||
- '"failed" not in result'
|
||||
- '"key" in result'
|
||||
- 'result.key == None'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue