Debian Codegraph @

test/integration/targets/ansible-test-sanity-pylint/deprecated_thing.py

raw
1 """
2 This file is not used by the integration test, but serves a related purpose.
3 It triggers sanity test failures that can only occur for ansible-core, which need to be ignored to ensure the pylint plugin is functioning properly.
4 """
5 from __future__ import annotations
6
7 from ansible.module_utils.datatag import deprecator_from_collection_name
8 from ansible.module_utils.common.warnings import deprecate
9
10
11 def do_stuff() -> None:
12 deprecator = deprecator_from_collection_name('ansible.builtin')
13
14 deprecate(msg='ansible-deprecated-version', version='2.18')
15 deprecate(msg='ansible-deprecated-no-version')
16 deprecate(msg='ansible-invalid-deprecated-version', version='not-a-version')
17 # collection-deprecated-version - ansible-core cannot encounter this
18 # collection-invalid-deprecated-version - ansible-core cannot encounter this
19 # ansible-deprecated-no-collection-name - ansible-core cannot encounter this
20 # wrong-collection-deprecated - ansible-core cannot encounter this
21 # ansible-expired-deprecated-date - ansible-core cannot encounter this
22 # ansible-invalid-deprecated-date - ansible-core cannot encounter this
23 # ansible-deprecated-both-version-and-date - ansible-core cannot encounter this
24 # removal-version-must-be-major - ansible-core cannot encounter this
25 deprecate(msg='ansible-deprecated-date-not-permitted', date='2099-01-01')
26 deprecate(msg='ansible-deprecated-unnecessary-collection-name', deprecator=deprecator, version='2.99')
27 deprecate(msg='ansible-deprecated-collection-name-not-permitted', collection_name='ansible.builtin', version='2.99')
28 # ansible-deprecated-both-collection-name-and-deprecator - ansible-core cannot encounter this