mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-14 07:55:05 +00:00
[stable-5] Remove unneccessary imports (#5977)
* 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.
(cherry picked from commit 2b8ac3c629)
* Re-add os import.
This commit is contained in:
parent
6932a937c5
commit
24210b32cf
46 changed files with 65 additions and 87 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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 = (
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -79,7 +79,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,
|
||||
filter_sensitive_attributes
|
||||
)
|
||||
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
|
||||
|
|
|
|||
|
|
@ -152,13 +152,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