mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-14 01:54:21 -07:00
Remove unneccessary imports (#5940)
* Remove unneccessary imports. * Keep unnecessary imports in module_utils - for now. * Make older sanity tests shut up. * Also make flake8 happier.
This commit is contained in:
parent
de193ac1bf
commit
2b8ac3c629
60 changed files with 74 additions and 108 deletions
|
@ -182,7 +182,7 @@ from ansible.module_utils.six import integer_types
|
|||
|
||||
GITLAB_IMP_ERR = None
|
||||
try:
|
||||
import gitlab
|
||||
import gitlab # noqa: F401, pylint: disable=unused-import
|
||||
HAS_GITLAB_PACKAGE = True
|
||||
except Exception:
|
||||
GITLAB_IMP_ERR = traceback.format_exc()
|
||||
|
|
|
@ -295,7 +295,6 @@ import io
|
|||
import json
|
||||
import os
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule, to_bytes
|
||||
from ansible.module_utils.six.moves import http_cookiejar as cookiejar
|
||||
|
|
|
@ -206,7 +206,7 @@ end_state:
|
|||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak \
|
||||
import KeycloakAPI, camel, keycloak_argument_spec, get_token, KeycloakError, is_struct_included
|
||||
import KeycloakAPI, keycloak_argument_spec, get_token, KeycloakError, is_struct_included
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
|
|
|
@ -201,8 +201,9 @@ end_state:
|
|||
}
|
||||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import KeycloakAPI, camel, \
|
||||
keycloak_argument_spec, get_token, KeycloakError, is_struct_included
|
||||
from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import (
|
||||
KeycloakAPI, keycloak_argument_spec, get_token, KeycloakError,
|
||||
)
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
|
|
|
@ -295,7 +295,7 @@ end_state:
|
|||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import KeycloakAPI, camel, \
|
||||
keycloak_argument_spec, get_token, KeycloakError, is_struct_included
|
||||
keycloak_argument_spec, get_token, KeycloakError
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
|
|
|
@ -225,8 +225,8 @@ end_state:
|
|||
}
|
||||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import KeycloakAPI, camel, \
|
||||
keycloak_argument_spec, get_token, KeycloakError, is_struct_included
|
||||
from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import KeycloakAPI, \
|
||||
keycloak_argument_spec, get_token, KeycloakError
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
|
|
|
@ -433,7 +433,7 @@ else:
|
|||
HAS_LXC = True
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.parsing.convert_bool import boolean, BOOLEANS_FALSE
|
||||
from ansible.module_utils.parsing.convert_bool import BOOLEANS_FALSE
|
||||
from ansible.module_utils.common.text.converters import to_text, to_bytes
|
||||
|
||||
|
||||
|
|
|
@ -99,7 +99,6 @@ EXAMPLES = '''
|
|||
import re
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.six.moves import shlex_quote
|
||||
|
||||
|
||||
def selfupdate(module, port_path):
|
||||
|
|
|
@ -81,7 +81,7 @@ profiles:
|
|||
'''
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, ManageIQPolicies, manageiq_argument_spec, manageiq_entities
|
||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec, manageiq_entities
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
@ -97,7 +97,6 @@ EXAMPLES = '''
|
|||
RETURN = r''' # '''
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
import os
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
|
|
|
@ -166,7 +166,6 @@ memset_api:
|
|||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id
|
||||
from ansible_collections.community.general.plugins.module_utils.memset import memset_api_call
|
||||
from ansible_collections.community.general.plugins.module_utils.memset import get_zone_id
|
||||
|
||||
|
||||
def api_validation(args=None):
|
||||
|
|
|
@ -101,10 +101,6 @@ import os
|
|||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import ModuleHelper
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import (
|
||||
ArgFormat
|
||||
)
|
||||
|
||||
|
||||
class MkSysB(ModuleHelper):
|
||||
module = dict(
|
||||
|
|
|
@ -165,7 +165,7 @@ operationStatusId:
|
|||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.ocapi_utils import OcapiUtils
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.module_utils.six.moves.urllib.parse import quote_plus, urljoin
|
||||
from ansible.module_utils.six.moves.urllib.parse import urljoin
|
||||
|
||||
# More will be added as module features are expanded
|
||||
CATEGORY_COMMANDS_ALL = {
|
||||
|
|
|
@ -141,7 +141,7 @@ status:
|
|||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.ocapi_utils import OcapiUtils
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
from ansible.module_utils.six.moves.urllib.parse import quote_plus, urljoin
|
||||
from ansible.module_utils.six.moves.urllib.parse import urljoin
|
||||
|
||||
# More will be added as module features are expanded
|
||||
CATEGORY_COMMANDS_ALL = {
|
||||
|
|
|
@ -292,8 +292,6 @@ try:
|
|||
except ImportError:
|
||||
HAS_PACKET_SDK = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
NAME_RE = r'({0}|{0}{1}*{0})'.format(r'[a-zA-Z0-9]', r'[a-zA-Z0-9\-]')
|
||||
HOSTNAME_RE = r'({0}\.)*{0}$'.format(NAME_RE)
|
||||
|
|
|
@ -177,7 +177,6 @@ import datetime
|
|||
import time
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.six.moves.urllib.parse import quote as urlquote
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import SCALEWAY_LOCATION, scaleway_argument_spec, Scaleway
|
||||
|
||||
SCALEWAY_SERVER_STATES = (
|
||||
|
|
|
@ -200,7 +200,7 @@ container:
|
|||
from copy import deepcopy
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
scaleway_waitable_resource_argument_spec, resource_attributes_should_be_changed,
|
||||
SecretVariables
|
||||
)
|
||||
|
|
|
@ -89,7 +89,7 @@ container:
|
|||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
)
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ container_namespace:
|
|||
from copy import deepcopy
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
scaleway_waitable_resource_argument_spec,
|
||||
resource_attributes_should_be_changed, SecretVariables
|
||||
)
|
||||
|
|
|
@ -81,7 +81,7 @@ container_namespace:
|
|||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
)
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ container_registry:
|
|||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
scaleway_waitable_resource_argument_spec, resource_attributes_should_be_changed
|
||||
)
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
|
|
@ -80,7 +80,7 @@ container_registry:
|
|||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
)
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ function:
|
|||
from copy import deepcopy
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
scaleway_waitable_resource_argument_spec, resource_attributes_should_be_changed,
|
||||
SecretVariables
|
||||
)
|
||||
|
|
|
@ -89,7 +89,7 @@ function:
|
|||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway
|
||||
)
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ function_namespace:
|
|||
from copy import deepcopy
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
scaleway_waitable_resource_argument_spec, resource_attributes_should_be_changed,
|
||||
SecretVariables
|
||||
)
|
||||
|
|
|
@ -81,7 +81,7 @@ function_namespace:
|
|||
'''
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import (
|
||||
SCALEWAY_ENDPOINT, SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway
|
||||
SCALEWAY_REGIONS, scaleway_argument_spec, Scaleway,
|
||||
)
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
|
|
@ -133,11 +133,10 @@ data:
|
|||
import traceback
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.scaleway import SCALEWAY_LOCATION, scaleway_argument_spec, Scaleway, payload_from_object
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||
|
||||
try:
|
||||
from ipaddress import ip_network
|
||||
from ipaddress import ip_network # noqa: F401, pylint: disable=unused-import
|
||||
except ImportError:
|
||||
IPADDRESS_IMP_ERR = traceback.format_exc()
|
||||
HAS_IPADDRESS = False
|
||||
|
|
|
@ -153,13 +153,13 @@ instance:
|
|||
|
||||
HAS_XENAPI = False
|
||||
try:
|
||||
import XenAPI
|
||||
import XenAPI # noqa: F401, pylint: disable=unused-import
|
||||
HAS_XENAPI = True
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.xenserver import (xenserver_common_argument_spec, XAPI, XenServerObject, get_object_ref,
|
||||
from ansible_collections.community.general.plugins.module_utils.xenserver import (xenserver_common_argument_spec, XenServerObject, get_object_ref,
|
||||
gather_vm_params, gather_vm_facts)
|
||||
|
||||
|
||||
|
|
|
@ -173,13 +173,13 @@ instance:
|
|||
|
||||
HAS_XENAPI = False
|
||||
try:
|
||||
import XenAPI
|
||||
import XenAPI # noqa: F401, pylint: disable=unused-import
|
||||
HAS_XENAPI = True
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.xenserver import (xenserver_common_argument_spec, XAPI, XenServerObject, get_object_ref,
|
||||
from ansible_collections.community.general.plugins.module_utils.xenserver import (xenserver_common_argument_spec, XenServerObject, get_object_ref,
|
||||
gather_vm_params, gather_vm_facts, set_vm_power_state,
|
||||
wait_for_vm_ip_address)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue