diff --git a/lib/ansible/modules/core b/lib/ansible/modules/core index 275fa3f055a..149f10f8b7f 160000 --- a/lib/ansible/modules/core +++ b/lib/ansible/modules/core @@ -1 +1 @@ -Subproject commit 275fa3f055aacf2286eed54c13bde17db5082035 +Subproject commit 149f10f8b7f0dfe669b3c5ef26c2f4107f589e61 diff --git a/lib/ansible/modules/extras b/lib/ansible/modules/extras index 3e1ea76a75c..cc2651422ad 160000 --- a/lib/ansible/modules/extras +++ b/lib/ansible/modules/extras @@ -1 +1 @@ -Subproject commit 3e1ea76a75c297e2c17a4cd0e7856ca82139c761 +Subproject commit cc2651422ad6c7971fa48a45d2e16ac297ededd6 diff --git a/test/sanity/validate-modules/README.rst b/test/sanity/validate-modules/README.rst new file mode 100644 index 00000000000..026aab85f9f --- /dev/null +++ b/test/sanity/validate-modules/README.rst @@ -0,0 +1,77 @@ +ansible-testing +=============== + +Python module to help test or validate Ansible, specifically ansible +modules + +Installation +------------ + +This module must be installed alongside the current development +release of Ansible to appropriately test the current development +state of modules. + +Usage +~~~~~ + +:: + + pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible + pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing + ansible-validate-modules /path/to/ansible-modules-extras + +Help +~~~~ + +:: + + usage: ansible-validate-modules [-h] [-w] [--exclude EXCLUDE] modules + + positional arguments: + modules Path to module or module directory + + optional arguments: + -h, --help show this help message and exit + -w, --warnings Show warnings + --exclude EXCLUDE RegEx exclusion pattern + +Current Validations +------------------- + +Modules +~~~~~~~ + +Errors +^^^^^^ + +#. Interpreter line is not ``#!/usr/bin/python`` +#. ``main()`` not at the bottom of the file +#. Module does not import ``ansible.module_utils.basic`` +#. Missing ``DOCUMENTATION`` +#. Documentation is invalid YAML +#. Invalid schema for ``DOCUMENTATION`` +#. Missing ``EXAMPLES`` +#. Invalid Python Syntax +#. Tabbed indentation +#. Use of ``sys.exit()`` instead of ``exit_json`` or ``fail_json`` +#. Missing GPLv3 license header in module +#. Powershell module missing ``WANT_JSON`` +#. Powershell module missing ``POWERSHELL_COMMON`` +#. New modules have the correct ``version_added`` +#. New arguments have the correct ``version_added`` +#. Modules should not import requests, instead use ``ansible.module_utils.urls`` +#. Missing ``RETURN`` for new modules + +Warnings +^^^^^^^^ + +#. Try/Except ``HAS_`` expression missing +#. Missing ``RETURN`` for existing modules +#. ``import json`` found +#. Module contains duplicate globals from basic.py + +Module Directories (Python Packages) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#. Missing ``__init__.py`` + diff --git a/ansible_testing/__init__.py b/test/sanity/validate-modules/__init__.py similarity index 100% rename from ansible_testing/__init__.py rename to test/sanity/validate-modules/__init__.py diff --git a/ansible_testing/module_args.py b/test/sanity/validate-modules/module_args.py similarity index 100% rename from ansible_testing/module_args.py rename to test/sanity/validate-modules/module_args.py diff --git a/ansible_testing/schema.py b/test/sanity/validate-modules/schema.py similarity index 100% rename from ansible_testing/schema.py rename to test/sanity/validate-modules/schema.py diff --git a/ansible_testing/utils.py b/test/sanity/validate-modules/utils.py similarity index 100% rename from ansible_testing/utils.py rename to test/sanity/validate-modules/utils.py diff --git a/ansible_testing/modules.py b/test/sanity/validate-modules/validate-modules old mode 100644 new mode 100755 similarity index 100% rename from ansible_testing/modules.py rename to test/sanity/validate-modules/validate-modules