diff options
author | Matt Clay <mclay@redhat.com> | 2020-06-22 19:05:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-22 19:05:30 -0700 |
commit | 4816bb4f43ee22f20fa7d75a79db659cc1cdeaf3 (patch) | |
tree | 4cf981e84fd5cb86174f8067d7178d731dece1c9 /test/integration/targets | |
parent | 234994fc075222f28943313024c7df5d7010bc37 (diff) | |
download | ansible-4816bb4f43ee22f20fa7d75a79db659cc1cdeaf3.tar.gz |
More boilerplate fixes. (#70224)
* Fix boilerplate in hacking dir.
* Fix boilerplate in docs dir.
* Fix boilerplate in integration tests.
* Fix boilerplate in examples.
Diffstat (limited to 'test/integration/targets')
35 files changed, 97 insertions, 1 deletions
diff --git a/test/integration/targets/ansible-runner/files/adhoc_example1.py b/test/integration/targets/ansible-runner/files/adhoc_example1.py index 3e0d841462..ab24bcad96 100644 --- a/test/integration/targets/ansible-runner/files/adhoc_example1.py +++ b/test/integration/targets/ansible-runner/files/adhoc_example1.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import json import os import sys diff --git a/test/integration/targets/ansible-runner/files/playbook_example1.py b/test/integration/targets/ansible-runner/files/playbook_example1.py index 83cb19ff26..550c1857cb 100644 --- a/test/integration/targets/ansible-runner/files/playbook_example1.py +++ b/test/integration/targets/ansible-runner/files/playbook_example1.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import json import os import sys diff --git a/test/integration/targets/async/library/async_test.py b/test/integration/targets/async/library/async_test.py index 3098bc601c..723058ab87 100644 --- a/test/integration/targets/async/library/async_test.py +++ b/test/integration/targets/async/library/async_test.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import json import sys diff --git a/test/integration/targets/async_fail/library/async_test.py b/test/integration/targets/async_fail/library/async_test.py index 838f2f07ea..e0cbd6fee5 100644 --- a/test/integration/targets/async_fail/library/async_test.py +++ b/test/integration/targets/async_fail/library/async_test.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import json import sys import time diff --git a/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py b/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py index 6c805fdd90..93958fc2ad 100644 --- a/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py +++ b/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import os import pexpect import sys diff --git a/test/integration/targets/expect/files/test_command.py b/test/integration/targets/expect/files/test_command.py index 685c50c229..e45c847e97 100644 --- a/test/integration/targets/expect/files/test_command.py +++ b/test/integration/targets/expect/files/test_command.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import sys try: diff --git a/test/integration/targets/get_url/files/testserver.py b/test/integration/targets/get_url/files/testserver.py index 81043b6616..24967d4f0d 100644 --- a/test/integration/targets/get_url/files/testserver.py +++ b/test/integration/targets/get_url/files/testserver.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import sys if __name__ == '__main__': diff --git a/test/integration/targets/group/files/gidget.py b/test/integration/targets/group/files/gidget.py index 128985e731..4b771516fd 100644 --- a/test/integration/targets/group/files/gidget.py +++ b/test/integration/targets/group/files/gidget.py @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import grp gids = [g.gr_gid for g in grp.getgrall()] diff --git a/test/integration/targets/ignore_unreachable/fake_connectors/bad_exec.py b/test/integration/targets/ignore_unreachable/fake_connectors/bad_exec.py index b5e9ca88a6..0d8c385b17 100644 --- a/test/integration/targets/ignore_unreachable/fake_connectors/bad_exec.py +++ b/test/integration/targets/ignore_unreachable/fake_connectors/bad_exec.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import ansible.plugins.connection.local as ansible_local from ansible.errors import AnsibleConnectionFailure diff --git a/test/integration/targets/ignore_unreachable/fake_connectors/bad_put_file.py b/test/integration/targets/ignore_unreachable/fake_connectors/bad_put_file.py index 98927997a1..d4131f45e0 100644 --- a/test/integration/targets/ignore_unreachable/fake_connectors/bad_put_file.py +++ b/test/integration/targets/ignore_unreachable/fake_connectors/bad_put_file.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import ansible.plugins.connection.local as ansible_local from ansible.errors import AnsibleConnectionFailure diff --git a/test/integration/targets/incidental_script_inventory_vmware_inventory/vmware_inventory.py b/test/integration/targets/incidental_script_inventory_vmware_inventory/vmware_inventory.py index 0271110c96..21d4153b5b 100755 --- a/test/integration/targets/incidental_script_inventory_vmware_inventory/vmware_inventory.py +++ b/test/integration/targets/incidental_script_inventory_vmware_inventory/vmware_inventory.py @@ -25,7 +25,9 @@ $ jq '._meta.hostvars[].config' data.json | head "firmware": "bios", """ -from __future__ import print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import atexit import datetime diff --git a/test/integration/targets/infra/library/test.py b/test/integration/targets/infra/library/test.py index 9386057517..dbc4b61085 100644 --- a/test/integration/targets/infra/library/test.py +++ b/test/integration/targets/infra/library/test.py @@ -1,6 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + from ansible.module_utils.basic import AnsibleModule diff --git a/test/integration/targets/module_precedence/lib_no_extension/ping b/test/integration/targets/module_precedence/lib_no_extension/ping index e30706e894..a28f4699ee 100644 --- a/test/integration/targets/module_precedence/lib_no_extension/ping +++ b/test/integration/targets/module_precedence/lib_no_extension/ping @@ -19,6 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], diff --git a/test/integration/targets/module_precedence/lib_with_extension/ping.py b/test/integration/targets/module_precedence/lib_with_extension/ping.py index e30706e894..a28f4699ee 100644 --- a/test/integration/targets/module_precedence/lib_with_extension/ping.py +++ b/test/integration/targets/module_precedence/lib_with_extension/ping.py @@ -19,6 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], diff --git a/test/integration/targets/module_precedence/multiple_roles/bar/library/ping.py b/test/integration/targets/module_precedence/multiple_roles/bar/library/ping.py index e7776001e2..98ef7b448c 100644 --- a/test/integration/targets/module_precedence/multiple_roles/bar/library/ping.py +++ b/test/integration/targets/module_precedence/multiple_roles/bar/library/ping.py @@ -19,6 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], diff --git a/test/integration/targets/module_precedence/multiple_roles/foo/library/ping.py b/test/integration/targets/module_precedence/multiple_roles/foo/library/ping.py index a6d153baf2..8860b7aa65 100644 --- a/test/integration/targets/module_precedence/multiple_roles/foo/library/ping.py +++ b/test/integration/targets/module_precedence/multiple_roles/foo/library/ping.py @@ -19,6 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], diff --git a/test/integration/targets/module_precedence/roles_no_extension/foo/library/ping b/test/integration/targets/module_precedence/roles_no_extension/foo/library/ping index a6d153baf2..8860b7aa65 100644 --- a/test/integration/targets/module_precedence/roles_no_extension/foo/library/ping +++ b/test/integration/targets/module_precedence/roles_no_extension/foo/library/ping @@ -19,6 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], diff --git a/test/integration/targets/module_precedence/roles_with_extension/foo/library/ping.py b/test/integration/targets/module_precedence/roles_with_extension/foo/library/ping.py index a6d153baf2..8860b7aa65 100644 --- a/test/integration/targets/module_precedence/roles_with_extension/foo/library/ping.py +++ b/test/integration/targets/module_precedence/roles_with_extension/foo/library/ping.py @@ -19,6 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], diff --git a/test/integration/targets/module_utils/library/test.py b/test/integration/targets/module_utils/library/test.py index fbb7e6e224..fb6c8a81c3 100644 --- a/test/integration/targets/module_utils/library/test.py +++ b/test/integration/targets/module_utils/library/test.py @@ -2,6 +2,8 @@ # Most of these names are only available via PluginLoader so pylint doesn't # know they exist # pylint: disable=no-name-in-module +__metaclass__ = type + results = {} # Test import with no from diff --git a/test/integration/targets/module_utils/library/test_env_override.py b/test/integration/targets/module_utils/library/test_env_override.py index 94e3051bf2..ebfb5ddff0 100644 --- a/test/integration/targets/module_utils/library/test_env_override.py +++ b/test/integration/targets/module_utils/library/test_env_override.py @@ -2,6 +2,9 @@ # Most of these names are only available via PluginLoader so pylint doesn't # know they exist # pylint: disable=no-name-in-module +from __future__ import absolute_import, division, print_function +__metaclass__ = type + from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.json_utils import data from ansible.module_utils.mork import data as mork_data diff --git a/test/integration/targets/module_utils/library/test_failure.py b/test/integration/targets/module_utils/library/test_failure.py index e1a87c2e71..258217a74e 100644 --- a/test/integration/targets/module_utils/library/test_failure.py +++ b/test/integration/targets/module_utils/library/test_failure.py @@ -1,4 +1,6 @@ #!/usr/bin/python +from __future__ import absolute_import, division, print_function +__metaclass__ = type results = {} # Test that we are rooted correctly diff --git a/test/integration/targets/module_utils/library/test_override.py b/test/integration/targets/module_utils/library/test_override.py index 9ff54bf949..b4e21cdd18 100644 --- a/test/integration/targets/module_utils/library/test_override.py +++ b/test/integration/targets/module_utils/library/test_override.py @@ -1,4 +1,7 @@ #!/usr/bin/python +from __future__ import absolute_import, division, print_function +__metaclass__ = type + from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.facts import data diff --git a/test/integration/targets/pause/test-pause.py b/test/integration/targets/pause/test-pause.py index 7b37c66646..866a2df6c9 100755 --- a/test/integration/targets/pause/test-pause.py +++ b/test/integration/targets/pause/test-pause.py @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import os import pexpect import sys diff --git a/test/integration/targets/pip/files/ansible_test_pip_chdir/__init__.py b/test/integration/targets/pip/files/ansible_test_pip_chdir/__init__.py index c8a79430f9..5d1f9aec74 100644 --- a/test/integration/targets/pip/files/ansible_test_pip_chdir/__init__.py +++ b/test/integration/targets/pip/files/ansible_test_pip_chdir/__init__.py @@ -1,2 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + + def main(): print("success") diff --git a/test/integration/targets/pip/files/setup.py b/test/integration/targets/pip/files/setup.py index 094064b7c0..aaf21875ca 100755 --- a/test/integration/targets/pip/files/setup.py +++ b/test/integration/targets/pip/files/setup.py @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + from setuptools import setup, find_packages setup( diff --git a/test/integration/targets/run_modules/library/test.py b/test/integration/targets/run_modules/library/test.py index bbe3182c58..15a92e9128 100644 --- a/test/integration/targets/run_modules/library/test.py +++ b/test/integration/targets/run_modules/library/test.py @@ -1,5 +1,8 @@ #!/usr/bin/python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + from ansible.module_utils.basic import AnsibleModule module = AnsibleModule(argument_spec=dict()) diff --git a/test/integration/targets/script/files/no_shebang.py b/test/integration/targets/script/files/no_shebang.py index c6c813afc4..f2d386a0b2 100644 --- a/test/integration/targets/script/files/no_shebang.py +++ b/test/integration/targets/script/files/no_shebang.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import sys sys.stdout.write("Script with shebang omitted") diff --git a/test/integration/targets/service/files/ansible_test_service.py b/test/integration/targets/service/files/ansible_test_service.py index c4feed8502..522493fcc7 100644 --- a/test/integration/targets/service/files/ansible_test_service.py +++ b/test/integration/targets/service/files/ansible_test_service.py @@ -3,6 +3,9 @@ # this is mostly based off of the code found here: # http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import os import resource import signal diff --git a/test/integration/targets/setup_rpm_repo/files/create-repo.py b/test/integration/targets/setup_rpm_repo/files/create-repo.py index 2337463c42..ec2c124012 100644 --- a/test/integration/targets/setup_rpm_repo/files/create-repo.py +++ b/test/integration/targets/setup_rpm_repo/files/create-repo.py @@ -1,5 +1,7 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import sys from collections import namedtuple diff --git a/test/integration/targets/template/role_filter/filter_plugins/myplugin.py b/test/integration/targets/template/role_filter/filter_plugins/myplugin.py index 44935ab0ea..b0a8889439 100644 --- a/test/integration/targets/template/role_filter/filter_plugins/myplugin.py +++ b/test/integration/targets/template/role_filter/filter_plugins/myplugin.py @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + class FilterModule(object): def filters(self): diff --git a/test/integration/targets/uri/files/testserver.py b/test/integration/targets/uri/files/testserver.py index 81043b6616..24967d4f0d 100644 --- a/test/integration/targets/uri/files/testserver.py +++ b/test/integration/targets/uri/files/testserver.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import sys if __name__ == '__main__': diff --git a/test/integration/targets/var_precedence/ansible-var-precedence-check.py b/test/integration/targets/var_precedence/ansible-var-precedence-check.py index e9b24adeff..fc31688be2 100755 --- a/test/integration/targets/var_precedence/ansible-var-precedence-check.py +++ b/test/integration/targets/var_precedence/ansible-var-precedence-check.py @@ -3,6 +3,9 @@ # A tool to check the order of precedence for ansible variables # https://github.com/ansible/ansible/blob/devel/test/integration/test_var_precedence.yml +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import json import os import sys diff --git a/test/integration/targets/vault/test-vault-client.py b/test/integration/targets/vault/test-vault-client.py index a2f17dc5cf..ee46188742 100755 --- a/test/integration/targets/vault/test-vault-client.py +++ b/test/integration/targets/vault/test-vault-client.py @@ -1,6 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} diff --git a/test/integration/targets/wait_for/files/testserver.py b/test/integration/targets/wait_for/files/testserver.py index 1f6f1187db..2b728b6c10 100644 --- a/test/integration/targets/wait_for/files/testserver.py +++ b/test/integration/targets/wait_for/files/testserver.py @@ -1,3 +1,6 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import sys if __name__ == '__main__': diff --git a/test/integration/targets/want_json_modules_posix/library/helloworld.py b/test/integration/targets/want_json_modules_posix/library/helloworld.py index ad0301cbcb..80f876175d 100644 --- a/test/integration/targets/want_json_modules_posix/library/helloworld.py +++ b/test/integration/targets/want_json_modules_posix/library/helloworld.py @@ -16,6 +16,9 @@ # WANT_JSON +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import json import sys |