From c9f76f6d499ae2320f2d1606b98469eaf43fdd70 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 24 May 2023 09:02:04 -0700 Subject: [PATCH] Remove unused import (#80875) Signed-off-by: Abhijeet Kasurde --- test/sanity/ignore.txt | 4 ---- .../integration/plugins/modules/sefcontext.py | 2 -- test/support/integration/plugins/modules/zypper.py | 1 - .../plugins/module_utils/network/common/utils.py | 14 -------------- .../plugins/action/win_reboot.py | 1 - 5 files changed, 22 deletions(-) diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt index c2dcf545d03..d3dffb52328 100644 --- a/test/sanity/ignore.txt +++ b/test/sanity/ignore.txt @@ -161,11 +161,7 @@ test/integration/targets/win_script/files/test_script_with_splatting.ps1 pslint: test/lib/ansible_test/_data/requirements/sanity.pslint.ps1 pslint:PSCustomUseLiteralPath # Uses wildcards on purpose test/lib/ansible_test/_util/target/setup/ConfigureRemotingForAnsible.ps1 pslint:PSCustomUseLiteralPath test/lib/ansible_test/_util/target/setup/requirements.py replace-urlopen -test/support/integration/plugins/modules/sefcontext.py pylint:unused-import -test/support/integration/plugins/modules/zypper.py pylint:unused-import -test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/utils.py pylint:unused-import test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/connection/network_cli.py pylint:pointless-string-statement -test/support/windows-integration/plugins/action/win_reboot.py pylint:unused-import test/support/integration/plugins/modules/timezone.py pylint:disallowed-name test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/compat/ipaddress.py no-unicode-literals test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/facts/facts.py pylint:unnecessary-comprehension diff --git a/test/support/integration/plugins/modules/sefcontext.py b/test/support/integration/plugins/modules/sefcontext.py index 638612f325a..946ae880a66 100644 --- a/test/support/integration/plugins/modules/sefcontext.py +++ b/test/support/integration/plugins/modules/sefcontext.py @@ -105,8 +105,6 @@ RETURN = r''' # Default return values ''' -import os -import subprocess import traceback from ansible.module_utils.basic import AnsibleModule, missing_required_lib diff --git a/test/support/integration/plugins/modules/zypper.py b/test/support/integration/plugins/modules/zypper.py index 678b227ba46..b5ed53075c6 100644 --- a/test/support/integration/plugins/modules/zypper.py +++ b/test/support/integration/plugins/modules/zypper.py @@ -202,7 +202,6 @@ EXAMPLES = ''' import xml import re from xml.dom.minidom import parseString as parseXML -from ansible.module_utils.six import iteritems from ansible.module_utils.common.text.converters import to_native # import module snippets diff --git a/test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/utils.py b/test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/utils.py index 23c3e8880e2..ac06e180dcf 100644 --- a/test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/utils.py +++ b/test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/utils.py @@ -42,20 +42,6 @@ from ansible.module_utils.six import iteritems, string_types from ansible.module_utils import basic from ansible.module_utils.parsing.convert_bool import boolean -# Backwards compatibility for 3rd party modules -# TODO(pabelanger): With move to ansible.netcommon, we should clean this code -# up and have modules import directly themself. -from ansible.module_utils.common.network import ( # noqa: F401 - to_bits, - is_netmask, - is_masklen, - to_netmask, - to_masklen, - to_subnet, - to_ipv6_network, - VALID_MASKS, -) - try: from jinja2 import Environment, StrictUndefined from jinja2.exceptions import UndefinedError diff --git a/test/support/windows-integration/plugins/action/win_reboot.py b/test/support/windows-integration/plugins/action/win_reboot.py index c0d380ba73b..8cadefc62d1 100644 --- a/test/support/windows-integration/plugins/action/win_reboot.py +++ b/test/support/windows-integration/plugins/action/win_reboot.py @@ -6,7 +6,6 @@ __metaclass__ = type from datetime import datetime -from ansible.errors import AnsibleError from ansible.module_utils.common.text.converters import to_native from ansible.plugins.action import ActionBase from ansible.plugins.action.reboot import ActionModule as RebootActionModule