mirror of https://github.com/ansible/ansible.git
validate-modules - Remove `__future__` limits (#79800)
* validate-modules - Remove `__future__` limits Limits on specific `__future__` imports are handled by other sanity tests. * Add integration test for module/plugin imports.pull/79810/head
parent
10eda5801a
commit
a3b7863098
@ -0,0 +1,7 @@
|
||||
minor_changes:
|
||||
- ansible-test - The ``validate-modules`` sanity test no longer limits the ``__future__`` imports that can be used.
|
||||
Other sanity tests that check ``__future__`` imports remain unchanged. As a result, the error code
|
||||
``illegal-future-imports`` is no longer used.
|
||||
bugfixes:
|
||||
- ansible-test - The ``validate-modules`` sanity test now properly enforces documentation before imports for plugins.
|
||||
Previously this was only enforced for modules due to a coding error.
|
@ -0,0 +1,16 @@
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ansible.plugins.lookup import LookupBase
|
||||
|
||||
DOCUMENTATION = """
|
||||
name: import_order_lookup
|
||||
short_description: Import order lookup
|
||||
description: Import order lookup.
|
||||
"""
|
||||
|
||||
|
||||
class LookupModule(LookupBase):
|
||||
def run(self, terms, variables=None, **kwargs):
|
||||
return []
|
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
DOCUMENTATION = '''
|
||||
module: import_order
|
||||
short_description: Import order test module
|
||||
description: Import order test module.
|
||||
author:
|
||||
- Ansible Core Team
|
||||
'''
|
||||
|
||||
EXAMPLES = '''#'''
|
||||
RETURN = ''''''
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
module = AnsibleModule(argument_spec=dict())
|
||||
module.exit_json()
|
Loading…
Reference in New Issue