mirror of https://github.com/ansible/ansible.git
Miscellaneous DT fixes (#84991)
* Use `_UNSET` instead of allowing `ellipsis` * Fix deprecation warning pre-check * Deprecation warnings from modules can now be disabled. * Deprecation warnings from modules get the "can be disabled" notice. * Include help text in pre-display fatal errors * Simplify lookup warning/debug messaging * Fix return type of `timedout` test plugin * Use `object` for `_UNSET` * Remove obsolete `convert_data` tests * Remove unnecessary template from test * Improve legacy YAML objects backward compat * Fix templar backward compat for None overridespull/85005/head
parent
e094d48b1b
commit
6cc97447aa
@ -0,0 +1,14 @@
|
||||
- hosts: testhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: invoke a module that returns a warning and deprecation warning
|
||||
noisy:
|
||||
register: result
|
||||
|
||||
- name: verify the warning and deprecation are visible in templating
|
||||
assert:
|
||||
that:
|
||||
- result.warnings | length == 1
|
||||
- result.warnings[0] == "This is a warning."
|
||||
- result.deprecations | length == 1
|
||||
- result.deprecations[0].msg == "This is a deprecation."
|
||||
@ -0,0 +1,14 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
def main() -> None:
|
||||
m = AnsibleModule({})
|
||||
m.warn("This is a warning.")
|
||||
m.deprecate("This is a deprecation.", version='9999.9')
|
||||
m.exit_json()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Loading…
Reference in New Issue