mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Ensure uri module always returns status even on failure (#56240)
- Also return url and update docs for other values to indicate they are only returned on success. - Add integration tests - Use info variable for common return values - Use -1 as default status rather than None. This is lines up with with existing code in urls.py - Add unit tests to ensure status and url are returned on failure
This commit is contained in:
@@ -102,9 +102,12 @@
|
||||
- name: Assert that the file was not downloaded
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- result.failed == true
|
||||
- "'Failed to validate the SSL certificate' in result.msg or ( result.msg is match('hostname .* doesn.t match .*'))"
|
||||
- "stat_result.stat.exists == false"
|
||||
- stat_result.stat.exists == false
|
||||
- result.status is defined
|
||||
- result.status == -1
|
||||
- result.url == 'https://' ~ badssl_host ~ '/'
|
||||
|
||||
- name: Clean up any cruft from the results directory
|
||||
file:
|
||||
|
||||
Reference in New Issue
Block a user