diff --git a/plugins/doc_fragments/netapp.py b/plugins/doc_fragments/netapp.py new file mode 100644 index 0000000000..f1a26ff064 --- /dev/null +++ b/plugins/doc_fragments/netapp.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- + +# Copyright: (c) 2018, Sumit Kumar , chris Archibald +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + + +class ModuleDocFragment(object): + + DOCUMENTATION = r''' +options: + - See respective platform section for more details +requirements: + - See respective platform section for more details +notes: + - Ansible modules are available for the following NetApp Storage Platforms: E-Series, ONTAP, SolidFire +''' + + # Documentation fragment for ONTAP (na_cdot) + ONTAP = r''' +options: + hostname: + required: true + description: + - The hostname or IP address of the ONTAP instance. + username: + required: true + description: + - This can be a Cluster-scoped or SVM-scoped account, depending on whether a Cluster-level or SVM-level API is required. + For more information, please read the documentation U(https://mysupport.netapp.com/NOW/download/software/nmsdk/9.4/). + aliases: ['user'] + password: + required: true + description: + - Password for the specified user. + aliases: ['pass'] +requirements: + - A physical or virtual clustered Data ONTAP system. The modules were developed with Clustered Data ONTAP 8.3 + - Ansible 2.2 + - netapp-lib (2015.9.25). Install using 'pip install netapp-lib' + +notes: + - The modules prefixed with na\\_cdot are built to support the ONTAP storage platform. + +''' + + # Documentation fragment for SolidFire + SOLIDFIRE = r''' +options: + hostname: + required: true + description: + - The hostname or IP address of the SolidFire cluster. + username: + required: true + description: + - Please ensure that the user has the adequate permissions. For more information, please read the official documentation + U(https://mysupport.netapp.com/documentation/docweb/index.html?productID=62636&language=en-US). + aliases: ['user'] + password: + required: true + description: + - Password for the specified user. + aliases: ['pass'] + +requirements: + - The modules were developed with SolidFire 10.1 + - solidfire-sdk-python (1.1.0.92) or greater. Install using 'pip install solidfire-sdk-python' + +notes: + - The modules prefixed with na\\_elementsw are built to support the SolidFire storage platform. + +''' + + # Documentation fragment for E-Series + ESERIES = r''' +options: + api_username: + required: true + type: str + description: + - The username to authenticate with the SANtricity Web Services Proxy or Embedded Web Services API. + api_password: + required: true + type: str + description: + - The password to authenticate with the SANtricity Web Services Proxy or Embedded Web Services API. + api_url: + required: true + type: str + description: + - The url to the SANtricity Web Services Proxy or Embedded Web Services API. + Example https://prod-1.wahoo.acme.com/devmgr/v2 + validate_certs: + required: false + default: true + description: + - Should https certificates be validated? + type: bool + ssid: + required: false + type: str + default: 1 + description: + - The ID of the array to manage. This value must be unique for each array. + +notes: + - The E-Series Ansible modules require either an instance of the Web Services Proxy (WSP), to be available to manage + the storage-system, or an E-Series storage-system that supports the Embedded Web Services API. + - Embedded Web Services is currently available on the E2800, E5700, EF570, and newer hardware models. + - M(netapp_e_storage_system) may be utilized for configuring the systems managed by a WSP instance. +''' diff --git a/plugins/lookup/avi.py b/plugins/lookup/avi.py index dfc8cc4f21..f19c036a28 100644 --- a/plugins/lookup/avi.py +++ b/plugins/lookup/avi.py @@ -53,10 +53,10 @@ from ansible.errors import AnsibleError, AnsibleParserError from ansible.plugins.lookup import LookupBase from ansible.utils.display import Display from ansible_collections.community.general.plugins.module_utils.network.avi.avi_api import (ApiSession, - AviCredentials, - AviServerError, - ObjectNotFound, - APIError) + AviCredentials, + AviServerError, + ObjectNotFound, + APIError) display = Display() diff --git a/plugins/module_utils/net_tools/netbox/__init__.py b/plugins/module_utils/net_tools/netbox/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/plugins/modules/cloud/cloudscale/cloudscale_volume.py b/plugins/modules/cloud/cloudscale/cloudscale_volume.py index 22680ffab7..83fcb751b6 100644 --- a/plugins/modules/cloud/cloudscale/cloudscale_volume.py +++ b/plugins/modules/cloud/cloudscale/cloudscale_volume.py @@ -172,8 +172,8 @@ tags: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.cloudscale import (AnsibleCloudscaleBase, - cloudscale_argument_spec, - ) + cloudscale_argument_spec, + ) class AnsibleCloudscaleVolume(AnsibleCloudscaleBase): diff --git a/plugins/modules/cloud/cloudstack/cs_instance_nic.py b/plugins/modules/cloud/cloudstack/cs_instance_nic.py index c2a0498d89..874ae3f896 100644 --- a/plugins/modules/cloud/cloudstack/cs_instance_nic.py +++ b/plugins/modules/cloud/cloudstack/cs_instance_nic.py @@ -148,8 +148,8 @@ project: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.cloudstack import (AnsibleCloudStack, - cs_argument_spec, - cs_required_together) + cs_argument_spec, + cs_required_together) class AnsibleCloudStackInstanceNic(AnsibleCloudStack): diff --git a/plugins/modules/cloud/huawei/hwc_network_vpc.py b/plugins/modules/cloud/huawei/hwc_network_vpc.py index f46c5fd062..937780145b 100644 --- a/plugins/modules/cloud/huawei/hwc_network_vpc.py +++ b/plugins/modules/cloud/huawei/hwc_network_vpc.py @@ -132,10 +132,10 @@ RETURN = ''' ############################################################################### from ansible_collections.community.general.plugins.module_utils.hwc_utils import (Config, HwcClientException, - HwcClientException404, HwcModule, - are_different_dicts, is_empty_value, - wait_to_finish, get_region, - build_path, navigate_value) + HwcClientException404, HwcModule, + are_different_dicts, is_empty_value, + wait_to_finish, get_region, + build_path, navigate_value) import re ############################################################################### diff --git a/plugins/modules/cloud/huawei/hwc_smn_topic.py b/plugins/modules/cloud/huawei/hwc_smn_topic.py index 952c939ab5..3b8e292616 100644 --- a/plugins/modules/cloud/huawei/hwc_smn_topic.py +++ b/plugins/modules/cloud/huawei/hwc_smn_topic.py @@ -111,9 +111,9 @@ update_time: ############################################################################### from ansible_collections.community.general.plugins.module_utils.hwc_utils import (Config, HwcClientException, - HwcModule, navigate_value, - are_different_dicts, is_empty_value, - build_path, get_region) + HwcModule, navigate_value, + are_different_dicts, is_empty_value, + build_path, get_region) import re ############################################################################### diff --git a/plugins/modules/cloud/rackspace/rax.py b/plugins/modules/cloud/rackspace/rax.py index b89c01a865..73c56a7abb 100644 --- a/plugins/modules/cloud/rackspace/rax.py +++ b/plugins/modules/cloud/rackspace/rax.py @@ -213,8 +213,8 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (FINAL_STATUSES, rax_argument_spec, rax_find_bootable_volume, - rax_find_image, rax_find_network, rax_find_volume, - rax_required_together, rax_to_dict, setup_rax_module) + rax_find_image, rax_find_network, rax_find_volume, + rax_required_together, rax_to_dict, setup_rax_module) from ansible.module_utils.six.moves import xrange from ansible.module_utils.six import string_types diff --git a/plugins/modules/cloud/rackspace/rax_cbs.py b/plugins/modules/cloud/rackspace/rax_cbs.py index f6395199c9..dcd97aab70 100644 --- a/plugins/modules/cloud/rackspace/rax_cbs.py +++ b/plugins/modules/cloud/rackspace/rax_cbs.py @@ -105,7 +105,7 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (VOLUME_STATUS, rax_argument_spec, rax_find_image, rax_find_volume, - rax_required_together, rax_to_dict, setup_rax_module) + rax_required_together, rax_to_dict, setup_rax_module) def cloud_block_storage(module, state, name, description, meta, size, diff --git a/plugins/modules/cloud/rackspace/rax_cbs_attachments.py b/plugins/modules/cloud/rackspace/rax_cbs_attachments.py index 4440499699..a393e57b8c 100644 --- a/plugins/modules/cloud/rackspace/rax_cbs_attachments.py +++ b/plugins/modules/cloud/rackspace/rax_cbs_attachments.py @@ -82,13 +82,13 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (NON_CALLABLES, - rax_argument_spec, - rax_find_server, - rax_find_volume, - rax_required_together, - rax_to_dict, - setup_rax_module, - ) + rax_argument_spec, + rax_find_server, + rax_find_volume, + rax_required_together, + rax_to_dict, + setup_rax_module, + ) def cloud_block_storage_attachments(module, state, volume, server, device, diff --git a/plugins/modules/cloud/rackspace/rax_clb.py b/plugins/modules/cloud/rackspace/rax_clb.py index c275243384..237e9d66df 100644 --- a/plugins/modules/cloud/rackspace/rax_clb.py +++ b/plugins/modules/cloud/rackspace/rax_clb.py @@ -133,12 +133,12 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (CLB_ALGORITHMS, - CLB_PROTOCOLS, - rax_argument_spec, - rax_required_together, - rax_to_dict, - setup_rax_module, - ) + CLB_PROTOCOLS, + rax_argument_spec, + rax_required_together, + rax_to_dict, + setup_rax_module, + ) def cloud_load_balancer(module, state, name, meta, algorithm, port, protocol, diff --git a/plugins/modules/cloud/rackspace/rax_clb_ssl.py b/plugins/modules/cloud/rackspace/rax_clb_ssl.py index 72ea2e3b86..ed8655b7a3 100644 --- a/plugins/modules/cloud/rackspace/rax_clb_ssl.py +++ b/plugins/modules/cloud/rackspace/rax_clb_ssl.py @@ -102,11 +102,11 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (rax_argument_spec, - rax_find_loadbalancer, - rax_required_together, - rax_to_dict, - setup_rax_module, - ) + rax_find_loadbalancer, + rax_required_together, + rax_to_dict, + setup_rax_module, + ) def cloud_load_balancer_ssl(module, loadbalancer, state, enabled, private_key, diff --git a/plugins/modules/cloud/rackspace/rax_dns.py b/plugins/modules/cloud/rackspace/rax_dns.py index b5f539a2d1..e540a16d53 100644 --- a/plugins/modules/cloud/rackspace/rax_dns.py +++ b/plugins/modules/cloud/rackspace/rax_dns.py @@ -71,10 +71,10 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (rax_argument_spec, - rax_required_together, - rax_to_dict, - setup_rax_module, - ) + rax_required_together, + rax_to_dict, + setup_rax_module, + ) def rax_dns(module, comment, email, name, state, ttl): diff --git a/plugins/modules/cloud/rackspace/rax_dns_record.py b/plugins/modules/cloud/rackspace/rax_dns_record.py index f130e82275..3d1576a2f2 100644 --- a/plugins/modules/cloud/rackspace/rax_dns_record.py +++ b/plugins/modules/cloud/rackspace/rax_dns_record.py @@ -123,12 +123,12 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (rax_argument_spec, - rax_find_loadbalancer, - rax_find_server, - rax_required_together, - rax_to_dict, - setup_rax_module, - ) + rax_find_loadbalancer, + rax_find_server, + rax_required_together, + rax_to_dict, + setup_rax_module, + ) def rax_dns_record_ptr(module, data=None, comment=None, loadbalancer=None, diff --git a/plugins/modules/cloud/rackspace/rax_facts.py b/plugins/modules/cloud/rackspace/rax_facts.py index 614fe0de0e..e49bb1dc1c 100644 --- a/plugins/modules/cloud/rackspace/rax_facts.py +++ b/plugins/modules/cloud/rackspace/rax_facts.py @@ -58,10 +58,10 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (rax_argument_spec, - rax_required_together, - rax_to_dict, - setup_rax_module, - ) + rax_required_together, + rax_to_dict, + setup_rax_module, + ) def rax_facts(module, address, name, server_id): diff --git a/plugins/modules/cloud/rackspace/rax_identity.py b/plugins/modules/cloud/rackspace/rax_identity.py index d9a39dc6cd..e1708060ed 100644 --- a/plugins/modules/cloud/rackspace/rax_identity.py +++ b/plugins/modules/cloud/rackspace/rax_identity.py @@ -54,7 +54,7 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (rax_argument_spec, rax_required_together, rax_to_dict, - setup_rax_module) + setup_rax_module) def cloud_identity(module, state, identity): diff --git a/plugins/modules/cloud/rackspace/rax_keypair.py b/plugins/modules/cloud/rackspace/rax_keypair.py index 90d1be93d9..1867ab5e4d 100644 --- a/plugins/modules/cloud/rackspace/rax_keypair.py +++ b/plugins/modules/cloud/rackspace/rax_keypair.py @@ -88,10 +88,10 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (rax_argument_spec, - rax_required_together, - rax_to_dict, - setup_rax_module, - ) + rax_required_together, + rax_to_dict, + setup_rax_module, + ) def rax_keypair(module, name, public_key, state): diff --git a/plugins/modules/cloud/rackspace/rax_scaling_group.py b/plugins/modules/cloud/rackspace/rax_scaling_group.py index d7fb527eb2..e16eab5f7c 100644 --- a/plugins/modules/cloud/rackspace/rax_scaling_group.py +++ b/plugins/modules/cloud/rackspace/rax_scaling_group.py @@ -144,7 +144,7 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (rax_argument_spec, rax_find_image, rax_find_network, - rax_required_together, rax_to_dict, setup_rax_module) + rax_required_together, rax_to_dict, setup_rax_module) from ansible.module_utils.six import string_types diff --git a/plugins/modules/cloud/rackspace/rax_scaling_policy.py b/plugins/modules/cloud/rackspace/rax_scaling_policy.py index 562facb77f..3c2cf267ac 100644 --- a/plugins/modules/cloud/rackspace/rax_scaling_policy.py +++ b/plugins/modules/cloud/rackspace/rax_scaling_policy.py @@ -124,7 +124,7 @@ except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.rax import (UUID, rax_argument_spec, rax_required_together, rax_to_dict, - setup_rax_module) + setup_rax_module) def rax_asp(module, at=None, change=0, cron=None, cooldown=300, diff --git a/plugins/modules/cloud/xenserver/xenserver_guest.py b/plugins/modules/cloud/xenserver/xenserver_guest.py index df54aeef42..703f661f46 100644 --- a/plugins/modules/cloud/xenserver/xenserver_guest.py +++ b/plugins/modules/cloud/xenserver/xenserver_guest.py @@ -443,10 +443,10 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.network import is_mac from ansible.module_utils import six from ansible_collections.community.general.plugins.module_utils.xenserver import (xenserver_common_argument_spec, XAPI, XenServerObject, get_object_ref, - gather_vm_params, gather_vm_facts, set_vm_power_state, wait_for_vm_ip_address, - is_valid_ip_addr, is_valid_ip_netmask, is_valid_ip_prefix, - ip_prefix_to_netmask, ip_netmask_to_prefix, - is_valid_ip6_addr, is_valid_ip6_prefix) + gather_vm_params, gather_vm_facts, set_vm_power_state, + wait_for_vm_ip_address, is_valid_ip_addr, is_valid_ip_netmask, + is_valid_ip_prefix, ip_prefix_to_netmask, ip_netmask_to_prefix, + is_valid_ip6_addr, is_valid_ip6_prefix) class XenServerVM(XenServerObject): diff --git a/plugins/modules/cloud/xenserver/xenserver_guest_info.py b/plugins/modules/cloud/xenserver/xenserver_guest_info.py index f55665c39c..4533e7a0f4 100644 --- a/plugins/modules/cloud/xenserver/xenserver_guest_info.py +++ b/plugins/modules/cloud/xenserver/xenserver_guest_info.py @@ -163,7 +163,7 @@ except ImportError: 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, - gather_vm_params, gather_vm_facts) + gather_vm_params, gather_vm_facts) class XenServerVM(XenServerObject): diff --git a/plugins/modules/cloud/xenserver/xenserver_guest_powerstate.py b/plugins/modules/cloud/xenserver/xenserver_guest_powerstate.py index 379e2a3216..025bd38ce8 100644 --- a/plugins/modules/cloud/xenserver/xenserver_guest_powerstate.py +++ b/plugins/modules/cloud/xenserver/xenserver_guest_powerstate.py @@ -186,7 +186,8 @@ except ImportError: 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, - gather_vm_params, gather_vm_facts, set_vm_power_state, wait_for_vm_ip_address) + gather_vm_params, gather_vm_facts, set_vm_power_state, + wait_for_vm_ip_address) class XenServerVM(XenServerObject): diff --git a/plugins/modules/network/a10/a10_server.py b/plugins/modules/network/a10/a10_server.py index be24f32bd8..3ffbadd66d 100644 --- a/plugins/modules/network/a10/a10_server.py +++ b/plugins/modules/network/a10/a10_server.py @@ -96,8 +96,8 @@ content: ''' import json -from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, axapi_failure, axapi_get_port_protocol, - axapi_enabled_disabled, AXAPI_PORT_PROTOCOLS) +from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, axapi_failure, + axapi_get_port_protocol, axapi_enabled_disabled, AXAPI_PORT_PROTOCOLS) from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import url_argument_spec diff --git a/plugins/modules/network/a10/a10_service_group.py b/plugins/modules/network/a10/a10_service_group.py index bebfc01334..cc05e03093 100644 --- a/plugins/modules/network/a10/a10_service_group.py +++ b/plugins/modules/network/a10/a10_service_group.py @@ -113,7 +113,8 @@ content: ''' import json -from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, axapi_failure, axapi_enabled_disabled) +from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, + axapi_failure, axapi_enabled_disabled) from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import url_argument_spec diff --git a/plugins/modules/network/a10/a10_virtual_server.py b/plugins/modules/network/a10/a10_virtual_server.py index 6e7b7829b1..8f61788f04 100644 --- a/plugins/modules/network/a10/a10_virtual_server.py +++ b/plugins/modules/network/a10/a10_virtual_server.py @@ -102,7 +102,8 @@ content: import json from ansible_collections.community.general.plugins.module_utils.network.a10.a10 import (axapi_call, a10_argument_spec, axapi_authenticate, axapi_failure, - axapi_enabled_disabled, axapi_get_vport_protocol, AXAPI_VPORT_PROTOCOLS) + axapi_enabled_disabled, axapi_get_vport_protocol, + AXAPI_VPORT_PROTOCOLS) from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.urls import url_argument_spec diff --git a/plugins/modules/network/ingate/ig_config.py b/plugins/modules/network/ingate/ig_config.py index 16936f7db3..5e02e6c4c1 100644 --- a/plugins/modules/network/ingate/ig_config.py +++ b/plugins/modules/network/ingate/ig_config.py @@ -409,7 +409,7 @@ download: from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.network.ingate.common import (ingate_argument_spec, - ingate_create_client) + ingate_create_client) try: from ingate import ingatesdk diff --git a/plugins/modules/network/ingate/ig_unit_information.py b/plugins/modules/network/ingate/ig_unit_information.py index b59ab5e199..4727d46f4a 100644 --- a/plugins/modules/network/ingate/ig_unit_information.py +++ b/plugins/modules/network/ingate/ig_unit_information.py @@ -124,8 +124,8 @@ unit-information: from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native from ansible_collections.community.general.plugins.module_utils.network.ingate.common import (ingate_argument_spec, - ingate_create_client, - is_ingatesdk_installed) + ingate_create_client, + is_ingatesdk_installed) try: from ingate import ingatesdk diff --git a/plugins/modules/network/netscaler/netscaler_cs_policy.py b/plugins/modules/network/netscaler/netscaler_cs_policy.py index d2b1c1423c..f31452d11f 100644 --- a/plugins/modules/network/netscaler/netscaler_cs_policy.py +++ b/plugins/modules/network/netscaler/netscaler_cs_policy.py @@ -113,7 +113,8 @@ diff: ''' from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_nitro_client, netscaler_common_arguments, log, loglines, ensure_feature_is_enabled +from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments, + log, loglines, ensure_feature_is_enabled) try: from nssrc.com.citrix.netscaler.nitro.resource.config.cs.cspolicy import cspolicy from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_exception diff --git a/plugins/modules/network/netscaler/netscaler_server.py b/plugins/modules/network/netscaler/netscaler_server.py index f6ccb07c98..e431b450bc 100644 --- a/plugins/modules/network/netscaler/netscaler_server.py +++ b/plugins/modules/network/netscaler/netscaler_server.py @@ -158,8 +158,10 @@ except ImportError as e: PYTHON_SDK_IMPORTED = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_nitro_client, netscaler_common_arguments, log, loglines, \ - get_immutables_intersection +from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, + netscaler_common_arguments, + log, loglines, + get_immutables_intersection) def server_exists(client, module): diff --git a/plugins/modules/network/netscaler/netscaler_service.py b/plugins/modules/network/netscaler/netscaler_service.py index 418e4bbfcb..85e1ca14b0 100644 --- a/plugins/modules/network/netscaler/netscaler_service.py +++ b/plugins/modules/network/netscaler/netscaler_service.py @@ -427,8 +427,8 @@ except ImportError as e: PYTHON_SDK_IMPORTED = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments, log, loglines, - get_immutables_intersection) +from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments, + log, loglines, get_immutables_intersection) def service_exists(client, module): diff --git a/plugins/modules/network/netscaler/netscaler_servicegroup.py b/plugins/modules/network/netscaler/netscaler_servicegroup.py index e86e629bd4..932d41bcbb 100644 --- a/plugins/modules/network/netscaler/netscaler_servicegroup.py +++ b/plugins/modules/network/netscaler/netscaler_servicegroup.py @@ -398,8 +398,8 @@ diff: from ansible.module_utils.basic import AnsibleModule import copy -from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_nitro_client, netscaler_common_arguments, log, \ - loglines, get_immutables_intersection +from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments, + log, loglines, get_immutables_intersection) try: from nssrc.com.citrix.netscaler.nitro.resource.config.basic.servicegroup import servicegroup from nssrc.com.citrix.netscaler.nitro.resource.config.basic.servicegroup_servicegroupmember_binding import servicegroup_servicegroupmember_binding diff --git a/plugins/modules/network/netscaler/netscaler_ssl_certkey.py b/plugins/modules/network/netscaler/netscaler_ssl_certkey.py index 5a14596a18..743c3b453f 100644 --- a/plugins/modules/network/netscaler/netscaler_ssl_certkey.py +++ b/plugins/modules/network/netscaler/netscaler_ssl_certkey.py @@ -152,8 +152,8 @@ except ImportError as e: PYTHON_SDK_IMPORTED = False from ansible.module_utils.basic import AnsibleModule -from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_nitro_client, netscaler_common_arguments, log, loglines, \ - get_immutables_intersection +from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_nitro_client, netscaler_common_arguments, + log, loglines, get_immutables_intersection) def key_exists(client, module): diff --git a/plugins/modules/storage/ibm/ibm_sa_host_ports.py b/plugins/modules/storage/ibm/ibm_sa_host_ports.py index 5a43bdb1db..dbc67d93d7 100644 --- a/plugins/modules/storage/ibm/ibm_sa_host_ports.py +++ b/plugins/modules/storage/ibm/ibm_sa_host_ports.py @@ -79,7 +79,7 @@ RETURN = ''' from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import (execute_pyxcli_command, connect_ssl, - spectrum_accelerate_spec, is_pyxcli_installed) + spectrum_accelerate_spec, is_pyxcli_installed) def main(): diff --git a/plugins/modules/storage/ibm/ibm_sa_vol_map.py b/plugins/modules/storage/ibm/ibm_sa_vol_map.py index d6f38b748a..5dacb98359 100644 --- a/plugins/modules/storage/ibm/ibm_sa_vol_map.py +++ b/plugins/modules/storage/ibm/ibm_sa_vol_map.py @@ -94,7 +94,7 @@ RETURN = ''' from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.ibm_sa_utils import (execute_pyxcli_command, - connect_ssl, spectrum_accelerate_spec, is_pyxcli_installed) + connect_ssl, spectrum_accelerate_spec, is_pyxcli_installed) def main(): diff --git a/plugins/modules/storage/netapp/na_cdot_aggregate.py b/plugins/modules/storage/netapp/na_cdot_aggregate.py index b2cf0b3f02..dfdca56c52 100644 --- a/plugins/modules/storage/netapp/na_cdot_aggregate.py +++ b/plugins/modules/storage/netapp/na_cdot_aggregate.py @@ -18,7 +18,7 @@ module: na_cdot_aggregate short_description: Manage NetApp cDOT aggregates. extends_documentation_fragment: -- netapp.ontap.netapp.na_ontap +- community.general.netapp.ontap author: Sumit Kumar (@timuster) diff --git a/plugins/modules/storage/netapp/na_cdot_license.py b/plugins/modules/storage/netapp/na_cdot_license.py index c4b58e288c..d733443457 100644 --- a/plugins/modules/storage/netapp/na_cdot_license.py +++ b/plugins/modules/storage/netapp/na_cdot_license.py @@ -18,7 +18,7 @@ module: na_cdot_license short_description: Manage NetApp cDOT protocol and feature licenses extends_documentation_fragment: -- netapp.ontap.netapp.na_ontap +- community.general.netapp.ontap author: Sumit Kumar (@timuster) diff --git a/plugins/modules/storage/netapp/na_cdot_lun.py b/plugins/modules/storage/netapp/na_cdot_lun.py index 7da3c81f6b..bd711d1922 100644 --- a/plugins/modules/storage/netapp/na_cdot_lun.py +++ b/plugins/modules/storage/netapp/na_cdot_lun.py @@ -18,7 +18,7 @@ module: na_cdot_lun short_description: Manage NetApp cDOT luns extends_documentation_fragment: -- netapp.ontap.netapp.na_ontap +- community.general.netapp.ontap author: Sumit Kumar (@timuster) diff --git a/plugins/modules/storage/netapp/na_cdot_qtree.py b/plugins/modules/storage/netapp/na_cdot_qtree.py index 99f73c9824..4a6400e25b 100644 --- a/plugins/modules/storage/netapp/na_cdot_qtree.py +++ b/plugins/modules/storage/netapp/na_cdot_qtree.py @@ -18,7 +18,7 @@ module: na_cdot_qtree short_description: Manage qtrees extends_documentation_fragment: -- netapp.ontap.netapp.na_ontap +- community.general.netapp.ontap author: Sumit Kumar (@timuster) diff --git a/plugins/modules/storage/netapp/na_cdot_svm.py b/plugins/modules/storage/netapp/na_cdot_svm.py index e7a41e6583..d0c02e2e5c 100644 --- a/plugins/modules/storage/netapp/na_cdot_svm.py +++ b/plugins/modules/storage/netapp/na_cdot_svm.py @@ -18,7 +18,7 @@ module: na_cdot_svm short_description: Manage NetApp cDOT svm extends_documentation_fragment: -- netapp.ontap.netapp.na_ontap +- community.general.netapp.ontap author: Sumit Kumar (@timuster) diff --git a/plugins/modules/storage/netapp/na_cdot_user.py b/plugins/modules/storage/netapp/na_cdot_user.py index 4012a2ffab..29bf26b9f2 100644 --- a/plugins/modules/storage/netapp/na_cdot_user.py +++ b/plugins/modules/storage/netapp/na_cdot_user.py @@ -18,7 +18,7 @@ module: na_cdot_user short_description: useradmin configuration and management extends_documentation_fragment: -- netapp.ontap.netapp.na_ontap +- community.general.netapp.ontap author: Sumit Kumar (@timuster) diff --git a/plugins/modules/storage/netapp/na_cdot_user_role.py b/plugins/modules/storage/netapp/na_cdot_user_role.py index e04d02bc29..0a0d508fce 100644 --- a/plugins/modules/storage/netapp/na_cdot_user_role.py +++ b/plugins/modules/storage/netapp/na_cdot_user_role.py @@ -18,7 +18,7 @@ module: na_cdot_user_role short_description: useradmin configuration and management extends_documentation_fragment: -- netapp.ontap.netapp.na_ontap +- community.general.netapp.ontap author: Sumit Kumar (@timuster) diff --git a/plugins/modules/storage/netapp/na_cdot_volume.py b/plugins/modules/storage/netapp/na_cdot_volume.py index 45a4392179..2610dab966 100644 --- a/plugins/modules/storage/netapp/na_cdot_volume.py +++ b/plugins/modules/storage/netapp/na_cdot_volume.py @@ -18,7 +18,7 @@ module: na_cdot_volume short_description: Manage NetApp cDOT volumes extends_documentation_fragment: -- netapp.ontap.netapp.na_ontap +- community.general.netapp.ontap author: Sumit Kumar (@timuster) diff --git a/plugins/modules/storage/netapp/netapp_e_alerts.py b/plugins/modules/storage/netapp/netapp_e_alerts.py index ac9dbff93e..072f4f25ca 100644 --- a/plugins/modules/storage/netapp/netapp_e_alerts.py +++ b/plugins/modules/storage/netapp/netapp_e_alerts.py @@ -20,7 +20,7 @@ description: - This module will allow the owner of the system to specify email recipients for these messages. author: Michael Price (@lmprice) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: state: diff --git a/plugins/modules/storage/netapp/netapp_e_amg.py b/plugins/modules/storage/netapp/netapp_e_amg.py index c34648458f..b93627592d 100644 --- a/plugins/modules/storage/netapp/netapp_e_amg.py +++ b/plugins/modules/storage/netapp/netapp_e_amg.py @@ -19,7 +19,7 @@ description: - Allows for the creation, removal and updating of Asynchronous Mirror Groups for NetApp E-series storage arrays author: Kevin Hulquest (@hulquest) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: name: diff --git a/plugins/modules/storage/netapp/netapp_e_asup.py b/plugins/modules/storage/netapp/netapp_e_asup.py index bb82400d45..c18efc557a 100644 --- a/plugins/modules/storage/netapp/netapp_e_asup.py +++ b/plugins/modules/storage/netapp/netapp_e_asup.py @@ -19,7 +19,7 @@ description: - Allow the auto-support settings to be configured for an individual E-Series storage-system author: Michael Price (@lmprice) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: state: diff --git a/plugins/modules/storage/netapp/netapp_e_auditlog.py b/plugins/modules/storage/netapp/netapp_e_auditlog.py index 95ec778b93..f90092f826 100644 --- a/plugins/modules/storage/netapp/netapp_e_auditlog.py +++ b/plugins/modules/storage/netapp/netapp_e_auditlog.py @@ -19,7 +19,7 @@ description: - This module allows an e-series storage system owner to set audit-log configuration parameters. author: Nathan Swartz (@ndswartz) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: max_records: diff --git a/plugins/modules/storage/netapp/netapp_e_drive_firmware.py b/plugins/modules/storage/netapp/netapp_e_drive_firmware.py index 5aaf386511..ba9f968279 100644 --- a/plugins/modules/storage/netapp/netapp_e_drive_firmware.py +++ b/plugins/modules/storage/netapp/netapp_e_drive_firmware.py @@ -20,7 +20,7 @@ description: author: - Nathan Swartz (@ndswartz) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: firmware: diff --git a/plugins/modules/storage/netapp/netapp_e_facts.py b/plugins/modules/storage/netapp/netapp_e_facts.py index 3be087a3ab..69d9506038 100644 --- a/plugins/modules/storage/netapp/netapp_e_facts.py +++ b/plugins/modules/storage/netapp/netapp_e_facts.py @@ -20,7 +20,7 @@ author: - Kevin Hulquest (@hulquest) - Nathan Swartz (@ndswartz) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries ''' diff --git a/plugins/modules/storage/netapp/netapp_e_firmware.py b/plugins/modules/storage/netapp/netapp_e_firmware.py index b835fe3735..66baf40971 100644 --- a/plugins/modules/storage/netapp/netapp_e_firmware.py +++ b/plugins/modules/storage/netapp/netapp_e_firmware.py @@ -20,7 +20,7 @@ description: author: - Nathan Swartz (@ndswartz) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: nvsram: diff --git a/plugins/modules/storage/netapp/netapp_e_global.py b/plugins/modules/storage/netapp/netapp_e_global.py index 4cf1aa835c..95b7fd4eae 100644 --- a/plugins/modules/storage/netapp/netapp_e_global.py +++ b/plugins/modules/storage/netapp/netapp_e_global.py @@ -19,7 +19,7 @@ description: - Allow the user to configure several of the global settings associated with an E-Series storage-system author: Michael Price (@lmprice) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: name: diff --git a/plugins/modules/storage/netapp/netapp_e_host.py b/plugins/modules/storage/netapp/netapp_e_host.py index 73445f4dcb..33ff5123e1 100644 --- a/plugins/modules/storage/netapp/netapp_e_host.py +++ b/plugins/modules/storage/netapp/netapp_e_host.py @@ -20,7 +20,7 @@ author: - Kevin Hulquest (@hulquest) - Nathan Swartz (@ndswartz) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: name: diff --git a/plugins/modules/storage/netapp/netapp_e_hostgroup.py b/plugins/modules/storage/netapp/netapp_e_hostgroup.py index 87338af793..ff27396589 100644 --- a/plugins/modules/storage/netapp/netapp_e_hostgroup.py +++ b/plugins/modules/storage/netapp/netapp_e_hostgroup.py @@ -22,7 +22,7 @@ author: - Nathan Swartz (@ndswartz) description: Create, update or destroy host groups on a NetApp E-Series storage array. extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: state: diff --git a/plugins/modules/storage/netapp/netapp_e_iscsi_interface.py b/plugins/modules/storage/netapp/netapp_e_iscsi_interface.py index c6f0a39e71..c0c5166fdf 100644 --- a/plugins/modules/storage/netapp/netapp_e_iscsi_interface.py +++ b/plugins/modules/storage/netapp/netapp_e_iscsi_interface.py @@ -19,7 +19,7 @@ description: - Configure settings of an E-Series iSCSI interface author: Michael Price (@lmprice) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: controller: diff --git a/plugins/modules/storage/netapp/netapp_e_iscsi_target.py b/plugins/modules/storage/netapp/netapp_e_iscsi_target.py index 124b4b9ca7..96e10075f0 100644 --- a/plugins/modules/storage/netapp/netapp_e_iscsi_target.py +++ b/plugins/modules/storage/netapp/netapp_e_iscsi_target.py @@ -19,7 +19,7 @@ description: - Configure the settings of an E-Series iSCSI target author: Michael Price (@lmprice) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: name: diff --git a/plugins/modules/storage/netapp/netapp_e_ldap.py b/plugins/modules/storage/netapp/netapp_e_ldap.py index 1c9ecb3ad2..4587f099ac 100644 --- a/plugins/modules/storage/netapp/netapp_e_ldap.py +++ b/plugins/modules/storage/netapp/netapp_e_ldap.py @@ -19,7 +19,7 @@ description: - Configure an E-Series system to allow authentication via an LDAP server author: Michael Price (@lmprice) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: state: diff --git a/plugins/modules/storage/netapp/netapp_e_lun_mapping.py b/plugins/modules/storage/netapp/netapp_e_lun_mapping.py index 1e14cec9b7..438873b7a5 100644 --- a/plugins/modules/storage/netapp/netapp_e_lun_mapping.py +++ b/plugins/modules/storage/netapp/netapp_e_lun_mapping.py @@ -21,7 +21,7 @@ short_description: NetApp E-Series create, delete, or modify lun mappings description: - Create, delete, or modify mappings between a volume and a targeted host/host+ group. extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: state: diff --git a/plugins/modules/storage/netapp/netapp_e_mgmt_interface.py b/plugins/modules/storage/netapp/netapp_e_mgmt_interface.py index 2ba856572d..e575a63c3f 100644 --- a/plugins/modules/storage/netapp/netapp_e_mgmt_interface.py +++ b/plugins/modules/storage/netapp/netapp_e_mgmt_interface.py @@ -21,7 +21,7 @@ author: - Michael Price (@lmprice) - Nathan Swartz (@ndswartz) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: state: diff --git a/plugins/modules/storage/netapp/netapp_e_storagepool.py b/plugins/modules/storage/netapp/netapp_e_storagepool.py index 05f209e962..d175bb4dc5 100644 --- a/plugins/modules/storage/netapp/netapp_e_storagepool.py +++ b/plugins/modules/storage/netapp/netapp_e_storagepool.py @@ -20,7 +20,7 @@ author: - Kevin Hulquest (@hulquest) - Nathan Swartz (@ndswartz) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: state: diff --git a/plugins/modules/storage/netapp/netapp_e_syslog.py b/plugins/modules/storage/netapp/netapp_e_syslog.py index 8be1de185e..3468425fb2 100644 --- a/plugins/modules/storage/netapp/netapp_e_syslog.py +++ b/plugins/modules/storage/netapp/netapp_e_syslog.py @@ -19,7 +19,7 @@ description: - Allow the syslog settings to be configured for an individual E-Series storage-system author: Nathan Swartz (@ndswartz) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: state: diff --git a/plugins/modules/storage/netapp/netapp_e_volume.py b/plugins/modules/storage/netapp/netapp_e_volume.py index 9a61563a22..dd7e06ee75 100644 --- a/plugins/modules/storage/netapp/netapp_e_volume.py +++ b/plugins/modules/storage/netapp/netapp_e_volume.py @@ -21,7 +21,7 @@ author: - Kevin Hulquest (@hulquest) - Nathan Swartz (@ndswartz) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: state: diff --git a/plugins/modules/storage/netapp/netapp_e_volume_copy.py b/plugins/modules/storage/netapp/netapp_e_volume_copy.py index 7c3043757a..976a9d1207 100644 --- a/plugins/modules/storage/netapp/netapp_e_volume_copy.py +++ b/plugins/modules/storage/netapp/netapp_e_volume_copy.py @@ -20,7 +20,7 @@ description: - Create and delete snapshots images on volume groups for NetApp E-series storage arrays. author: Kevin Hulquest (@hulquest) extends_documentation_fragment: -- netapp.ontap.netapp.eseries +- community.general.netapp.eseries options: api_username: diff --git a/plugins/modules/storage/netapp/sf_account_manager.py b/plugins/modules/storage/netapp/sf_account_manager.py index 139bdfe0cd..9c0afa4ca5 100644 --- a/plugins/modules/storage/netapp/sf_account_manager.py +++ b/plugins/modules/storage/netapp/sf_account_manager.py @@ -21,7 +21,7 @@ deprecated: alternative: please use M(na_elementsw_account) short_description: Manage SolidFire accounts extends_documentation_fragment: -- netapp.ontap.netapp.solidfire +- community.general.netapp.solidfire author: Sumit Kumar (@timuster) description: diff --git a/plugins/modules/storage/netapp/sf_check_connections.py b/plugins/modules/storage/netapp/sf_check_connections.py index 1e6641d741..a3dc10ac97 100644 --- a/plugins/modules/storage/netapp/sf_check_connections.py +++ b/plugins/modules/storage/netapp/sf_check_connections.py @@ -21,7 +21,7 @@ deprecated: alternative: please use M(na_elementsw_check_connections) short_description: Check connectivity to MVIP and SVIP. extends_documentation_fragment: -- netapp.ontap.netapp.solidfire +- community.general.netapp.solidfire author: Sumit Kumar (@timuster) description: diff --git a/plugins/modules/storage/netapp/sf_snapshot_schedule_manager.py b/plugins/modules/storage/netapp/sf_snapshot_schedule_manager.py index b9fe50263d..219f3b1be9 100644 --- a/plugins/modules/storage/netapp/sf_snapshot_schedule_manager.py +++ b/plugins/modules/storage/netapp/sf_snapshot_schedule_manager.py @@ -20,7 +20,7 @@ deprecated: alternative: please use M(na_elementsw_snapshot_schedule) short_description: Manage SolidFire snapshot schedules extends_documentation_fragment: -- netapp.ontap.netapp.solidfire +- community.general.netapp.solidfire author: Sumit Kumar (@timuster) description: diff --git a/plugins/modules/storage/netapp/sf_volume_access_group_manager.py b/plugins/modules/storage/netapp/sf_volume_access_group_manager.py index 8ce3f2d34f..3361e645cc 100644 --- a/plugins/modules/storage/netapp/sf_volume_access_group_manager.py +++ b/plugins/modules/storage/netapp/sf_volume_access_group_manager.py @@ -21,7 +21,7 @@ deprecated: alternative: please use M(na_elementsw_access_group) short_description: Manage SolidFire Volume Access Groups extends_documentation_fragment: -- netapp.ontap.netapp.solidfire +- community.general.netapp.solidfire author: Sumit Kumar (@timuster) description: diff --git a/plugins/modules/storage/netapp/sf_volume_manager.py b/plugins/modules/storage/netapp/sf_volume_manager.py index 4ebf9fa0d5..feaa7b8d6a 100644 --- a/plugins/modules/storage/netapp/sf_volume_manager.py +++ b/plugins/modules/storage/netapp/sf_volume_manager.py @@ -21,7 +21,7 @@ deprecated: alternative: please use M(na_elementsw_volume) short_description: Manage SolidFire volumes extends_documentation_fragment: -- netapp.ontap.netapp.solidfire +- community.general.netapp.solidfire author: Sumit Kumar (@timuster) description: diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 63a17028a8..00c8155d24 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -3502,8 +3502,6 @@ tests/unit/module_utils/hwc/test_dict_comparison.py future-import-boilerplate tests/unit/module_utils/hwc/test_dict_comparison.py metaclass-boilerplate tests/unit/module_utils/hwc/test_hwc_utils.py future-import-boilerplate tests/unit/module_utils/hwc/test_hwc_utils.py metaclass-boilerplate -tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py future-import-boilerplate -tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py metaclass-boilerplate tests/unit/module_utils/network/avi/test_avi_api_utils.py future-import-boilerplate tests/unit/module_utils/network/avi/test_avi_api_utils.py metaclass-boilerplate tests/unit/module_utils/network/ftd/test_common.py future-import-boilerplate diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index a08dbbf928..72c40e3d74 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -3539,8 +3539,6 @@ tests/unit/module_utils/hwc/test_dict_comparison.py future-import-boilerplate tests/unit/module_utils/hwc/test_dict_comparison.py metaclass-boilerplate tests/unit/module_utils/hwc/test_hwc_utils.py future-import-boilerplate tests/unit/module_utils/hwc/test_hwc_utils.py metaclass-boilerplate -tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py future-import-boilerplate -tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py metaclass-boilerplate tests/unit/module_utils/network/avi/test_avi_api_utils.py future-import-boilerplate tests/unit/module_utils/network/avi/test_avi_api_utils.py metaclass-boilerplate tests/unit/module_utils/network/ftd/test_common.py future-import-boilerplate diff --git a/tests/unit/module_utils/gcp/test_auth.py b/tests/unit/module_utils/gcp/test_auth.py index 84a628d51b..e91f945f3a 100644 --- a/tests/unit/module_utils/gcp/test_auth.py +++ b/tests/unit/module_utils/gcp/test_auth.py @@ -21,8 +21,8 @@ import pytest from ansible_collections.community.general.tests.unit.compat import mock, unittest from ansible_collections.community.general.plugins.module_utils.gcp import (_get_gcp_ansible_credentials, _get_gcp_credentials, _get_gcp_environ_var, - _get_gcp_environment_credentials, - _validate_credentials_file) + _get_gcp_environment_credentials, + _validate_credentials_file) # Fake data/function used for testing fake_env_data = {'GCE_EMAIL': 'gce-email'} diff --git a/tests/unit/module_utils/gcp/test_gcp_utils.py b/tests/unit/module_utils/gcp/test_gcp_utils.py index ef39c7e4f2..249abee761 100644 --- a/tests/unit/module_utils/gcp/test_gcp_utils.py +++ b/tests/unit/module_utils/gcp/test_gcp_utils.py @@ -17,9 +17,9 @@ # along with Ansible. If not, see . from ansible_collections.community.general.tests.unit.compat import unittest from ansible_collections.google.cloud.plugins.module_utils.gcp_utils import (GcpRequest, - navigate_hash, - remove_nones_from_dict, - replace_resource_dict) + navigate_hash, + remove_nones_from_dict, + replace_resource_dict) class ReplaceResourceDictTestCase(unittest.TestCase): diff --git a/tests/unit/module_utils/net_tools/netbox/__init__.py b/tests/unit/module_utils/net_tools/netbox/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py b/tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py deleted file mode 100644 index c36a58417a..0000000000 --- a/tests/unit/module_utils/net_tools/netbox/test_netbox_utils.py +++ /dev/null @@ -1,152 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright: (c) 2019, Bruno Inec (@sweenu) -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -import pytest - -from ansible_collections.netbox.netbox.plugins.module_utils.net_tools.netbox.netbox_utils import ( - QUERY_TYPES, - _build_diff, - create_netbox_object, - delete_netbox_object, - update_netbox_object, - normalize_data, -) - - -def test_normalize_data(): - assert "name" not in QUERY_TYPES - assert QUERY_TYPES.get("rack") == "slug" - assert QUERY_TYPES.get("primary_ip") != "slug" - - raw_data = { - "name": "Some name", - "primary_ip": "10.3.72.74/31", - "rack": "Some rack", - } - normalized_data = raw_data.copy() - normalized_data["rack"] = "some-rack" - - assert normalize_data(raw_data) == normalized_data - - -def test_build_diff(): - before = "The state before" - after = {"A": "more", "complicated": "state"} - diff = _build_diff(before=before, after=after) - assert diff == {"before": before, "after": after} - - -@pytest.fixture -def nb_obj_mock(mocker): - serialized_object = {"The serialized": "object"} - nb_obj = mocker.Mock(name="nb_obj_mock") - nb_obj.delete.return_value = True - nb_obj.update.return_value = True - nb_obj.update.side_effect = serialized_object.update - nb_obj.serialize.return_value = serialized_object - - return nb_obj - - -@pytest.fixture -def endpoint_mock(mocker, nb_obj_mock): - endpoint = mocker.Mock(name="endpoint_mock") - endpoint.create.return_value = nb_obj_mock - - return endpoint - - -@pytest.fixture -def on_creation_diff(): - return _build_diff(before={"state": "absent"}, after={"state": "present"}) - - -@pytest.fixture -def on_deletion_diff(): - return _build_diff(before={"state": "present"}, after={"state": "absent"}) - - -@pytest.fixture -def data(): - return {"name": "Some Netbox object name"} - - -def test_create_netbox_object(endpoint_mock, data, on_creation_diff): - return_value = endpoint_mock.create().serialize() - - serialized_obj, diff = create_netbox_object( - endpoint_mock, data, check_mode=False - ) - assert endpoint_mock.create.called_once_with(data) - assert serialized_obj == return_value - assert diff == on_creation_diff - - -def test_create_netbox_object_in_check_mode(endpoint_mock, data, on_creation_diff): - serialized_obj, diff = create_netbox_object( - endpoint_mock, data, check_mode=True - ) - assert endpoint_mock.create.not_called() - assert serialized_obj == data - assert diff == on_creation_diff - - -def test_delete_netbox_object(nb_obj_mock, on_deletion_diff): - serialized_obj, diff = delete_netbox_object(nb_obj_mock, check_mode=False) - assert nb_obj_mock.delete.called_once() - assert serialized_obj == nb_obj_mock.serialize() - assert diff == on_deletion_diff - - -def test_delete_netbox_object_in_check_mode(nb_obj_mock, on_deletion_diff): - serialized_obj, diff = delete_netbox_object(nb_obj_mock, check_mode=True) - assert nb_obj_mock.delete.not_called() - assert serialized_obj == nb_obj_mock.serialize() - assert diff == on_deletion_diff - - -def test_update_netbox_object_no_changes(nb_obj_mock): - unchanged_data = nb_obj_mock.serialize() - serialized_obj, diff = update_netbox_object(nb_obj_mock, unchanged_data, check_mode=True) - assert nb_obj_mock.update.not_called() - assert serialized_obj == unchanged_data - assert diff is None - - -@pytest.fixture -def changed_serialized_obj(nb_obj_mock): - changed_serialized_obj = nb_obj_mock.serialize().copy() - changed_serialized_obj[list(changed_serialized_obj.keys())[0]] += " (modified)" - - return changed_serialized_obj - - -@pytest.fixture -def on_update_diff(nb_obj_mock, changed_serialized_obj): - return _build_diff(before=nb_obj_mock.serialize().copy(), after=changed_serialized_obj) - - -def test_update_netbox_object_with_changes( - nb_obj_mock, changed_serialized_obj, on_update_diff -): - serialized_obj, diff = update_netbox_object( - nb_obj_mock, changed_serialized_obj, check_mode=False - ) - assert nb_obj_mock.update.called_once_with(changed_serialized_obj) - assert serialized_obj == nb_obj_mock.serialize() - assert diff == on_update_diff - - -def test_update_netbox_object_with_changes_in_check_mode( - nb_obj_mock, changed_serialized_obj, on_update_diff -): - updated_serialized_obj = nb_obj_mock.serialize().copy() - updated_serialized_obj.update(changed_serialized_obj) - - serialized_obj, diff = update_netbox_object( - nb_obj_mock, changed_serialized_obj, check_mode=True - ) - assert nb_obj_mock.update.not_called() - - assert serialized_obj == updated_serialized_obj - assert diff == on_update_diff diff --git a/tests/unit/module_utils/network/aci/test_aci.py b/tests/unit/module_utils/network/aci/test_aci.py index 2933eae57b..fa448a663a 100644 --- a/tests/unit/module_utils/network/aci/test_aci.py +++ b/tests/unit/module_utils/network/aci/test_aci.py @@ -9,7 +9,7 @@ __metaclass__ = type import sys from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.cisco.aci.plugins.module_utils.network.aci.aci import ACIModule +from ansible_collections.cisco.aci.plugins.module_utils.aci import ACIModule from ansible.module_utils.six import PY2 from ansible.module_utils._text import to_native diff --git a/tests/unit/module_utils/network/netscaler/test_netscaler.py b/tests/unit/module_utils/network/netscaler/test_netscaler.py index 0e0b5bb612..8b4aa9a664 100644 --- a/tests/unit/module_utils/network/netscaler/test_netscaler.py +++ b/tests/unit/module_utils/network/netscaler/test_netscaler.py @@ -21,7 +21,8 @@ from ansible_collections.community.general.tests.unit.compat import unittest from ansible_collections.community.general.tests.unit.compat.mock import Mock -from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import ConfigProxy, get_immutables_intersection, ensure_feature_is_enabled, log, loglines +from ansible_collections.community.general.plugins.module_utils.network.netscaler.netscaler import (ConfigProxy, get_immutables_intersection, + ensure_feature_is_enabled, log, loglines) class TestNetscalerConfigProxy(unittest.TestCase): diff --git a/tests/unit/modules/cloud/kubevirt/kubevirt_fixtures.py b/tests/unit/modules/cloud/kubevirt/kubevirt_fixtures.py new file mode 100644 index 0000000000..f91bb02679 --- /dev/null +++ b/tests/unit/modules/cloud/kubevirt/kubevirt_fixtures.py @@ -0,0 +1,73 @@ +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +import pytest + +from ansible_collections.community.general.tests.unit.compat.mock import MagicMock + +from ansible_collections.community.kubernetes.plugins.module_utils.common import K8sAnsibleMixin +from ansible_collections.community.kubernetes.plugins.module_utils.raw import KubernetesRawModule +from ansible_collections.community.general.plugins.module_utils.kubevirt import KubeVirtRawModule + +import openshift.dynamic + +RESOURCE_DEFAULT_ARGS = {'api_version': 'v1alpha3', 'group': 'kubevirt.io', + 'prefix': 'apis', 'namespaced': True} + + +class AnsibleExitJson(Exception): + """Exception class to be raised by module.exit_json and caught + by the test case""" + def __init__(self, **kwargs): + for k in kwargs: + setattr(self, k, kwargs[k]) + + def __getitem__(self, attr): + return getattr(self, attr) + + +class AnsibleFailJson(Exception): + """Exception class to be raised by module.fail_json and caught + by the test case""" + def __init__(self, **kwargs): + for k in kwargs: + setattr(self, k, kwargs[k]) + + def __getitem__(self, attr): + return getattr(self, attr) + + +def exit_json(*args, **kwargs): + kwargs['success'] = True + if 'changed' not in kwargs: + kwargs['changed'] = False + raise AnsibleExitJson(**kwargs) + + +def fail_json(*args, **kwargs): + kwargs['success'] = False + raise AnsibleFailJson(**kwargs) + + +@pytest.fixture() +def base_fixture(monkeypatch): + monkeypatch.setattr( + KubernetesRawModule, "exit_json", exit_json) + monkeypatch.setattr( + KubernetesRawModule, "fail_json", fail_json) + # Create mock methods in Resource directly, otherwise dyn client + # tries binding those to corresponding methods in DynamicClient + # (with partial()), which is more problematic to intercept + openshift.dynamic.Resource.get = MagicMock() + openshift.dynamic.Resource.create = MagicMock() + openshift.dynamic.Resource.delete = MagicMock() + openshift.dynamic.Resource.patch = MagicMock() + openshift.dynamic.Resource.search = MagicMock() + openshift.dynamic.Resource.watch = MagicMock() + # Globally mock some methods, since all tests will use this + KubernetesRawModule.patch_resource = MagicMock() + KubernetesRawModule.patch_resource.return_value = ({}, None) + K8sAnsibleMixin.get_api_client = MagicMock() + K8sAnsibleMixin.get_api_client.return_value = None + K8sAnsibleMixin.find_resource = MagicMock() + KubeVirtRawModule.find_supported_resource = MagicMock() diff --git a/tests/unit/modules/cloud/kubevirt/test_kubevirt_rs.py b/tests/unit/modules/cloud/kubevirt/test_kubevirt_rs.py index 03e7a227f0..7ab7ee6675 100644 --- a/tests/unit/modules/cloud/kubevirt/test_kubevirt_rs.py +++ b/tests/unit/modules/cloud/kubevirt/test_kubevirt_rs.py @@ -3,9 +3,9 @@ import pytest openshiftdynamic = pytest.importorskip("openshift.dynamic") from ansible_collections.community.general.tests.unit.modules.utils import set_module_args -from ansible_collections.community.general.tests.unit.utils.kubevirt_fixtures import base_fixture, RESOURCE_DEFAULT_ARGS, AnsibleExitJson +from .kubevirt_fixtures import base_fixture, RESOURCE_DEFAULT_ARGS, AnsibleExitJson -from ansible_collections.community.kubernetes.plugins.module_utils.k8s.raw import KubernetesRawModule +from ansible_collections.community.kubernetes.plugins.module_utils.raw import KubernetesRawModule from ansible_collections.community.general.plugins.modules.cloud.kubevirt import kubevirt_rs as mymodule KIND = 'VirtualMachineInstanceReplicaSet' diff --git a/tests/unit/modules/cloud/kubevirt/test_kubevirt_vm.py b/tests/unit/modules/cloud/kubevirt/test_kubevirt_vm.py index 3c5cd13761..d51b92b100 100644 --- a/tests/unit/modules/cloud/kubevirt/test_kubevirt_vm.py +++ b/tests/unit/modules/cloud/kubevirt/test_kubevirt_vm.py @@ -3,7 +3,7 @@ import pytest openshiftdynamic = pytest.importorskip("openshift.dynamic") from ansible_collections.community.general.tests.unit.modules.utils import set_module_args -from ansible_collections.community.general.tests.unit.utils.kubevirt_fixtures import base_fixture, RESOURCE_DEFAULT_ARGS, AnsibleExitJson +from .kubevirt_fixtures import base_fixture, RESOURCE_DEFAULT_ARGS, AnsibleExitJson from ansible_collections.community.general.plugins.module_utils.kubevirt import KubeVirtRawModule from ansible_collections.community.general.plugins.modules.cloud.kubevirt import kubevirt_vm as mymodule diff --git a/tests/unit/modules/cloud/xenserver/test_xenserver_guest_powerstate.py b/tests/unit/modules/cloud/xenserver/test_xenserver_guest_powerstate.py index 2ecd2f7a03..17cdebaca7 100644 --- a/tests/unit/modules/cloud/xenserver/test_xenserver_guest_powerstate.py +++ b/tests/unit/modules/cloud/xenserver/test_xenserver_guest_powerstate.py @@ -130,10 +130,13 @@ testcase_module_params_wait = { @pytest.mark.parametrize('power_state', testcase_set_powerstate['params'], ids=testcase_set_powerstate['ids']) def test_xenserver_guest_powerstate_set_power_state(mocker, fake_ansible_module, XenAPI, xenserver_guest_powerstate, power_state): """Tests power state change handling.""" - mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', return_value=fake_xenapi_ref('VM')) - mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={"power_state": "Someoldstate"}) - mocked_set_vm_power_state = mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.set_vm_power_state', - return_value=power_state) + mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', + return_value=fake_xenapi_ref('VM')) + mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', + return_value={"power_state": "Someoldstate"}) + mocked_set_vm_power_state = mocker.patch( + 'ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.set_vm_power_state', + return_value=power_state) mocked_xenapi = mocker.patch.object(XenAPI.Session, 'xenapi', create=True) @@ -171,13 +174,17 @@ def test_xenserver_guest_powerstate_present(mocker, patch_ansible_module, capfd, """ fake_vm_facts = {"fake-vm-fact": True} - mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', return_value=fake_xenapi_ref('VM')) + mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', + return_value=fake_xenapi_ref('VM')) mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={}) - mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts', return_value=fake_vm_facts) - mocked_set_vm_power_state = mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.set_vm_power_state', - return_value=(True, "somenewstate")) - mocked_wait_for_vm_ip_address = mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.wait_for_vm_ip_address', - return_value={}) + mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts', + return_value=fake_vm_facts) + mocked_set_vm_power_state = mocker.patch( + 'ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.set_vm_power_state', + return_value=(True, "somenewstate")) + mocked_wait_for_vm_ip_address = mocker.patch( + 'ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.wait_for_vm_ip_address', + return_value={}) mocked_xenapi = mocker.patch.object(XenAPI.Session, 'xenapi', create=True) @@ -214,7 +221,8 @@ def test_xenserver_guest_powerstate_other(mocker, patch_ansible_module, capfd, X """ fake_vm_facts = {"fake-vm-fact": True} - mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', return_value=fake_xenapi_ref('VM')) + mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', + return_value=fake_xenapi_ref('VM')) mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={}) mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts', return_value=fake_vm_facts) mocked_set_vm_power_state = mocker.patch( @@ -258,7 +266,8 @@ def test_xenserver_guest_powerstate_wait(mocker, patch_ansible_module, capfd, Xe """ fake_vm_facts = {"fake-vm-fact": True} - mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', return_value=fake_xenapi_ref('VM')) + mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.get_object_ref', + return_value=fake_xenapi_ref('VM')) mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_params', return_value={}) mocker.patch('ansible_collections.community.general.plugins.modules.cloud.xenserver.xenserver_guest_powerstate.gather_vm_facts', return_value=fake_vm_facts) mocked_set_vm_power_state = mocker.patch( diff --git a/tests/unit/modules/network/exos/test_exos_facts.py b/tests/unit/modules/network/exos/test_exos_facts.py index 01b27d54fa..97e6417c7d 100644 --- a/tests/unit/modules/network/exos/test_exos_facts.py +++ b/tests/unit/modules/network/exos/test_exos_facts.py @@ -39,7 +39,8 @@ class TestExosFactsModule(TestExosModule): self.mock_run_commands = patch('ansible_collections.community.general.plugins.module_utils.network.exos.facts.legacy.base.run_commands') self.run_commands = self.mock_run_commands.start() - self.mock_get_resource_connection = patch('ansible_collections.ansible.netcommon.plugins.module_utils.network.common.facts.facts.get_resource_connection') + self.mock_get_resource_connection = patch('ansible_collections.ansible.netcommon.plugins.module_utils.network.' + 'common.facts.facts.get_resource_connection') self.get_resource_connection = self.mock_get_resource_connection.start() def tearDown(self): diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_device.py b/tests/unit/modules/network/fortimanager/test_fmgr_device.py index 93315ae0bc..b638d0d832 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_device.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_device.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_discover_device(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -105,7 +105,7 @@ def test_discover_device(fixture_data, mocker): def test_add_device(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -149,7 +149,7 @@ def test_add_device(fixture_data, mocker): def test_delete_device(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -193,7 +193,7 @@ def test_delete_device(fixture_data, mocker): def test_get_device(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_device_config.py b/tests/unit/modules/network/fortimanager/test_fmgr_device_config.py index 9013d1452a..b1745aa1bf 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_device_config.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_device_config.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_update_device_hostname(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -108,7 +108,7 @@ def test_update_device_hostname(fixture_data, mocker): def test_update_device_interface(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -155,7 +155,7 @@ def test_update_device_interface(fixture_data, mocker): def test_exec_config(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_device_group.py b/tests/unit/modules/network/fortimanager/test_fmgr_device_group.py index ad000eb30d..82a028424b 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_device_group.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_device_group.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_add_device_group(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -113,7 +113,7 @@ def test_add_device_group(fixture_data, mocker): def test_delete_device_group(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -143,7 +143,7 @@ def test_delete_device_group(fixture_data, mocker): def test_add_group_member(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -173,7 +173,7 @@ def test_add_group_member(fixture_data, mocker): def test_delete_group_member(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_device_provision_template.py b/tests/unit/modules/network/fortimanager/test_fmgr_device_provision_template.py index be8e8b49e3..df48df3093 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_device_provision_template.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_device_provision_template.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -63,7 +63,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_get_devprof(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -771,7 +771,7 @@ def test_get_devprof(fixture_data, mocker): def test_set_devprof(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -849,7 +849,7 @@ def test_set_devprof(fixture_data, mocker): def test_set_devprof_scope(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -927,7 +927,7 @@ def test_set_devprof_scope(fixture_data, mocker): def test_set_devprof_snmp(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -1145,7 +1145,7 @@ def test_set_devprof_snmp(fixture_data, mocker): def test_set_devprof_snmp_v2c(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -1223,7 +1223,7 @@ def test_set_devprof_snmp_v2c(fixture_data, mocker): def test_set_devprof_snmp_v3(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -1301,7 +1301,7 @@ def test_set_devprof_snmp_v3(fixture_data, mocker): def test_set_devprof_syslog(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -1379,7 +1379,7 @@ def test_set_devprof_syslog(fixture_data, mocker): def test_set_devprof_ntp(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -1527,7 +1527,7 @@ def test_set_devprof_ntp(fixture_data, mocker): def test_set_devprof_admin(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -1605,7 +1605,7 @@ def test_set_devprof_admin(fixture_data, mocker): def test_set_devprof_smtp(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -1683,7 +1683,7 @@ def test_set_devprof_smtp(fixture_data, mocker): def test_set_devprof_dns(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_address.py b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_address.py index df5abc22f7..04c3302022 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_address.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_address.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_fwobj_ipv4(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # @@ -121,7 +121,7 @@ def test_fmgr_fwobj_ipv4(fixture_data, mocker): def test_fmgr_fwobj_ipv6(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # @@ -142,7 +142,7 @@ def test_fmgr_fwobj_ipv6(fixture_data, mocker): def test_fmgr_fwobj_multicast(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_ippool.py b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_ippool.py index 5fd335da66..ef7fe779c3 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_ippool.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_ippool.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_fwobj_ippool_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_ippool6.py b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_ippool6.py index 080f9ae405..f4dbb06b6b 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_ippool6.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_ippool6.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_fwobj_ippool6_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_service.py b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_service.py index e44dcf29f1..9416c7fcb7 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_service.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_service.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_fwobj_service_custom(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # @@ -103,7 +103,7 @@ def test_fmgr_fwobj_service_custom(fixture_data, mocker): def test_fmgr_fwobj_service_group(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # @@ -115,7 +115,7 @@ def test_fmgr_fwobj_service_group(fixture_data, mocker): def test_fmgr_fwobj_service_category(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_vip.py b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_vip.py index 4fb5ebbfe1..88da608229 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_vip.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_fwobj_vip.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_firewall_vip_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_fwpol_ipv4.py b/tests/unit/modules/network/fortimanager/test_fmgr_fwpol_ipv4.py index 8cba1d28b5..b6d581bf51 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_fwpol_ipv4.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_fwpol_ipv4.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_firewall_policy_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_fwpol_package.py b/tests/unit/modules/network/fortimanager/test_fmgr_fwpol_package.py index fc8af016d9..ebd3c89d70 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_fwpol_package.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_fwpol_package.py @@ -20,7 +20,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -62,7 +62,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_fwpol_package(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # @@ -80,7 +80,7 @@ def test_fmgr_fwpol_package(fixture_data, mocker): def test_fmgr_fwpol_package_folder(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_ha.py b/tests/unit/modules/network/fortimanager/test_fmgr_ha.py index d283ea3b58..9b5d201a0e 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_ha.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_ha.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_set_ha_mode(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -133,7 +133,7 @@ def test_fmgr_set_ha_mode(fixture_data, mocker): def test_fmgr_get_ha_peer_list(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -173,7 +173,7 @@ def test_fmgr_get_ha_peer_list(fixture_data, mocker): def test_fmgr_set_ha_peer(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_query.py b/tests/unit/modules/network/fortimanager/test_fmgr_query.py index af703ae472..c1b22d9ca1 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_query.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_query.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_get_custom(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -84,7 +84,7 @@ def test_fmgr_get_custom(fixture_data, mocker): def test_fmgr_get_task_status(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_script.py b/tests/unit/modules/network/fortimanager/test_fmgr_script.py index ebf5884c85..f01505127e 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_script.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_script.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_set_script(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -84,7 +84,7 @@ def test_set_script(fixture_data, mocker): def test_delete_script(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### @@ -107,7 +107,7 @@ def test_delete_script(fixture_data, mocker): def test_execute_script(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_appctrl.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_appctrl.py index f68ad9cdf1..d143497ea6 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_appctrl.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_appctrl.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_application_list_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_av.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_av.py index 74f2e79eed..20d175f9f4 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_av.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_av.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_antivirus_profile_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_dns.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_dns.py index e52bf7deb3..9d689bc65d 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_dns.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_dns.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_dnsfilter_profile_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_ips.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_ips.py index 7eb893b2da..cbb524a120 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_ips.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_ips.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_ips_sensor_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_profile_group.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_profile_group.py index 6bd2d3a33c..9a2bfc4762 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_profile_group.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_profile_group.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_firewall_profile_group_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Fixture sets used:########################### diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_proxy.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_proxy.py index aa4138f91b..a36b8d87cf 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_proxy.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_proxy.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_web_proxy_profile_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_spam.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_spam.py index 5514223c56..8cbc93a1cd 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_spam.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_spam.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_spamfilter_profile_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_ssl_ssh.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_ssl_ssh.py index 9f06b0f912..304783f76c 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_ssl_ssh.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_ssl_ssh.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_firewall_ssl_ssh_profile_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) output = fmgr_secprof_ssl_ssh.fmgr_firewall_ssl_ssh_profile_modify(fmg_instance, fixture_data[0]['paramgram_used']) assert output['raw_response']['status']['code'] == 0 diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_voip.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_voip.py index 88c388c917..0b5a83d162 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_voip.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_voip.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_voip_profile_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_waf.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_waf.py index 9029512bc5..8e36d91abf 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_waf.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_waf.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_waf_profile_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) output = fmgr_secprof_waf.fmgr_waf_profile_modify(fmg_instance, fixture_data[0]['paramgram_used']) assert output['raw_response']['status']['code'] == 0 diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_wanopt.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_wanopt.py index f02e152697..3a6182a35f 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_wanopt.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_wanopt.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_wanopt_profile_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) # Test using fixture 1 # diff --git a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_web.py b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_web.py index 3e0e92dd90..4154010eaa 100644 --- a/tests/unit/modules/network/fortimanager/test_fmgr_secprof_web.py +++ b/tests/unit/modules/network/fortimanager/test_fmgr_secprof_web.py @@ -19,7 +19,7 @@ __metaclass__ = type import os import json -from ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager import FortiManagerHandler +from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager import FortiManagerHandler import pytest try: @@ -61,7 +61,7 @@ fmg_instance = FortiManagerHandler(connection_mock, module_mock) def test_fmgr_webfilter_profile_modify(fixture_data, mocker): - mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.network.fortimanager.fortimanager.FortiManagerHandler.process_request', + mocker.patch('ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.fortimanager.FortiManagerHandler.process_request', side_effect=fixture_data) output = fmgr_secprof_web.fmgr_webfilter_profile_modify(fmg_instance, fixture_data[0]['paramgram_used']) assert output['raw_response']['status']['code'] == 0 diff --git a/tests/unit/modules/network/netscaler/test_netscaler_nitro_request.py b/tests/unit/modules/network/netscaler/test_netscaler_nitro_request.py index 3d2eaa0c96..25f474586f 100644 --- a/tests/unit/modules/network/netscaler/test_netscaler_nitro_request.py +++ b/tests/unit/modules/network/netscaler/test_netscaler_nitro_request.py @@ -215,7 +215,8 @@ class TestNetscalerNitroRequestModule(TestModule): nitro_auth_token='##DDASKLFDJ', )) module_mock = Mock(params=args, from_json=json.loads) - with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', Mock(return_value=module_mock)): + with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', + Mock(return_value=module_mock)): with tempfile.TemporaryFile() as r: actual_body = { 'errorcode': 258, @@ -252,7 +253,8 @@ class TestNetscalerNitroRequestModule(TestModule): nitro_auth_token='##DDASKLFDJ', )) module_mock = Mock(params=args, from_json=json.loads) - with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', Mock(return_value=module_mock)): + with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', + Mock(return_value=module_mock)): with tempfile.TemporaryFile() as r: actual_body = {} r.write(codecs.encode(json.dumps(actual_body), 'utf-8')) @@ -283,7 +285,8 @@ class TestNetscalerNitroRequestModule(TestModule): nitro_pass='nsroot', )) module_mock = Mock(params=args, from_json=json.loads) - with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', Mock(return_value=module_mock)): + with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', + Mock(return_value=module_mock)): body = { 'errorcode': 258, 'message': 'Numerical error 258', @@ -324,7 +327,8 @@ class TestNetscalerNitroRequestModule(TestModule): 'property2': 'value2', } module_mock = Mock(params=args, from_json=json.loads) - with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', Mock(return_value=module_mock)): + with patch('ansible_collections.community.general.plugins.modules.network.netscaler.netscaler_nitro_request.AnsibleModule', + Mock(return_value=module_mock)): instance = netscaler_nitro_request.NitroAPICaller() data = {resource: resource_data} diff --git a/tests/unit/modules/remote_management/dellemc/test_ome_device_info.py b/tests/unit/modules/remote_management/dellemc/test_ome_device_info.py index 8782cad640..8a12b82b8c 100644 --- a/tests/unit/modules/remote_management/dellemc/test_ome_device_info.py +++ b/tests/unit/modules/remote_management/dellemc/test_ome_device_info.py @@ -49,13 +49,17 @@ class TestOmeDeviceInfo(object): @pytest.fixture def get_device_identifier_map_mock(self, mocker): - response_class_mock = mocker.patch('ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_device_identifier_map') + response_class_mock = mocker.patch( + 'ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_device_identifier_map' + ) response_class_mock.return_value = resource_detailed_inventory return response_class_mock.return_value @pytest.fixture def get_resource_parameters_mock(self, mocker): - response_class_mock = mocker.patch('ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_resource_parameters') + response_class_mock = mocker.patch( + 'ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_resource_parameters' + ) return response_class_mock def test_main_basic_inventory_success_case(self, module_mock, validate_inputs_mock, connection_mock, get_resource_parameters_mock, response_mock): @@ -143,7 +147,9 @@ class TestOmeDeviceInfo(object): @pytest.mark.parametrize("module_params", params) def test_get_device_identifier_map(self, module_params, connection_mock, mocker): - get_device_id_from_service_tags_mock = mocker.patch('ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_device_id_from_service_tags') + get_device_id_from_service_tags_mock = mocker.patch( + 'ansible_collections.community.general.plugins.modules.remote_management.dellemc.ome_device_info._get_device_id_from_service_tags' + ) get_device_id_from_service_tags_mock.return_value = None res = self.module._get_device_identifier_map(module_params, connection_mock) assert isinstance(res, dict) diff --git a/tests/unit/modules/remote_management/oneview/oneview_module_loader.py b/tests/unit/modules/remote_management/oneview/oneview_module_loader.py index d27cbe51f3..4e0f3a5039 100644 --- a/tests/unit/modules/remote_management/oneview/oneview_module_loader.py +++ b/tests/unit/modules/remote_management/oneview/oneview_module_loader.py @@ -11,9 +11,9 @@ sys.modules['hpOneView.oneview_client'] = Mock() ONEVIEW_MODULE_UTILS_PATH = 'ansible_collections.community.general.plugins.module_utils.oneview' from ansible_collections.community.general.plugins.module_utils.oneview import (OneViewModuleException, - OneViewModuleTaskError, - OneViewModuleResourceNotFound, - OneViewModuleBase) + OneViewModuleTaskError, + OneViewModuleResourceNotFound, + OneViewModuleBase) from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_ethernet_network import EthernetNetworkModule from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_ethernet_network_info import EthernetNetworkInfoModule diff --git a/tests/unit/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py b/tests/unit/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py index 034cf851f7..7c22d16cc1 100644 --- a/tests/unit/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py +++ b/tests/unit/modules/remote_management/oneview/test_oneview_logical_interconnect_group_info.py @@ -2,7 +2,9 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from ansible_collections.community.general.tests.unit.compat import unittest -from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_logical_interconnect_group_info import LogicalInterconnectGroupInfoModule +from ansible_collections.community.general.plugins.modules.remote_management.oneview.oneview_logical_interconnect_group_info import ( + LogicalInterconnectGroupInfoModule +) from .hpe_test_utils import FactsParamsTestCase diff --git a/tests/unit/modules/source_control/gitlab/test_gitlab_deploy_key.py b/tests/unit/modules/source_control/gitlab/test_gitlab_deploy_key.py index 4c14f45bee..a0a81a63fc 100644 --- a/tests/unit/modules/source_control/gitlab/test_gitlab_deploy_key.py +++ b/tests/unit/modules/source_control/gitlab/test_gitlab_deploy_key.py @@ -19,9 +19,9 @@ def _dummy(x): pytestmark = [] try: from .gitlab import (GitlabModuleTestCase, - python_version_match_requirement, - resp_get_project, resp_find_project_deploy_key, - resp_create_project_deploy_key, resp_delete_project_deploy_key) + python_version_match_requirement, + resp_get_project, resp_find_project_deploy_key, + resp_create_project_deploy_key, resp_delete_project_deploy_key) # GitLab module requirements if python_version_match_requirement(): diff --git a/tests/unit/modules/source_control/gitlab/test_gitlab_group.py b/tests/unit/modules/source_control/gitlab/test_gitlab_group.py index 4313ad1fc0..6205ec5e60 100644 --- a/tests/unit/modules/source_control/gitlab/test_gitlab_group.py +++ b/tests/unit/modules/source_control/gitlab/test_gitlab_group.py @@ -19,9 +19,9 @@ def _dummy(x): pytestmark = [] try: from .gitlab import (GitlabModuleTestCase, - python_version_match_requirement, - resp_get_group, resp_get_missing_group, resp_create_group, - resp_create_subgroup, resp_delete_group, resp_find_group_project) + python_version_match_requirement, + resp_get_group, resp_get_missing_group, resp_create_group, + resp_create_subgroup, resp_delete_group, resp_find_group_project) # GitLab module requirements if python_version_match_requirement(): diff --git a/tests/unit/modules/source_control/gitlab/test_gitlab_hook.py b/tests/unit/modules/source_control/gitlab/test_gitlab_hook.py index fe6ab70f87..1d9b2eb357 100644 --- a/tests/unit/modules/source_control/gitlab/test_gitlab_hook.py +++ b/tests/unit/modules/source_control/gitlab/test_gitlab_hook.py @@ -18,9 +18,9 @@ def _dummy(x): pytestmark = [] try: from .gitlab import (GitlabModuleTestCase, - python_version_match_requirement, - resp_get_project, resp_find_project_hook, - resp_create_project_hook, resp_delete_project_hook) + python_version_match_requirement, + resp_get_project, resp_find_project_hook, + resp_create_project_hook, resp_delete_project_hook) # GitLab module requirements if python_version_match_requirement(): diff --git a/tests/unit/modules/source_control/gitlab/test_gitlab_project.py b/tests/unit/modules/source_control/gitlab/test_gitlab_project.py index 79d1cb0d81..ea211e3c7b 100644 --- a/tests/unit/modules/source_control/gitlab/test_gitlab_project.py +++ b/tests/unit/modules/source_control/gitlab/test_gitlab_project.py @@ -19,9 +19,9 @@ def _dummy(x): pytestmark = [] try: from .gitlab import (GitlabModuleTestCase, - python_version_match_requirement, - resp_get_group, resp_get_project_by_name, resp_create_project, - resp_get_project, resp_delete_project, resp_get_user) + python_version_match_requirement, + resp_get_group, resp_get_project_by_name, resp_create_project, + resp_get_project, resp_delete_project, resp_get_user) # GitLab module requirements if python_version_match_requirement(): diff --git a/tests/unit/modules/source_control/gitlab/test_gitlab_runner.py b/tests/unit/modules/source_control/gitlab/test_gitlab_runner.py index 2b265d7e37..b7a39b5918 100644 --- a/tests/unit/modules/source_control/gitlab/test_gitlab_runner.py +++ b/tests/unit/modules/source_control/gitlab/test_gitlab_runner.py @@ -19,9 +19,9 @@ def _dummy(x): pytestmark = [] try: from .gitlab import (GitlabModuleTestCase, - python_version_match_requirement, - resp_find_runners_list, resp_get_runner, - resp_create_runner, resp_delete_runner) + python_version_match_requirement, + resp_find_runners_list, resp_get_runner, + resp_create_runner, resp_delete_runner) # GitLab module requirements if python_version_match_requirement(): diff --git a/tests/unit/modules/source_control/gitlab/test_gitlab_user.py b/tests/unit/modules/source_control/gitlab/test_gitlab_user.py index 0c5f9c6a69..45dcf6c6dc 100644 --- a/tests/unit/modules/source_control/gitlab/test_gitlab_user.py +++ b/tests/unit/modules/source_control/gitlab/test_gitlab_user.py @@ -19,11 +19,11 @@ def _dummy(x): pytestmark = [] try: from .gitlab import (GitlabModuleTestCase, - python_version_match_requirement, - resp_find_user, resp_get_user, resp_get_user_keys, - resp_create_user_keys, resp_create_user, resp_delete_user, - resp_get_member, resp_get_group, resp_add_member, - resp_update_member, resp_get_member) + python_version_match_requirement, + resp_find_user, resp_get_user, resp_get_user_keys, + resp_create_user_keys, resp_create_user, resp_delete_user, + resp_get_member, resp_get_group, resp_add_member, + resp_update_member, resp_get_member) # GitLab module requirements if python_version_match_requirement(): diff --git a/tests/unit/modules/system/interfaces_file/interfaces_file/test_interfaces_file.py b/tests/unit/modules/system/interfaces_file/interfaces_file/test_interfaces_file.py index 02104dfd96..ef77eb96f0 100644 --- a/tests/unit/modules/system/interfaces_file/interfaces_file/test_interfaces_file.py +++ b/tests/unit/modules/system/interfaces_file/interfaces_file/test_interfaces_file.py @@ -158,7 +158,8 @@ class TestInterfacesFileModule(unittest.TestCase): fail_json_iterations = [] for i, options in enumerate(options_list): try: - dummy, lines = interfaces_file.setInterfaceOption(module, lines, options['iface'], options['option'], options['value'], options['state']) + dummy, lines = interfaces_file.setInterfaceOption(module, lines, options['iface'], options['option'], + options['value'], options['state']) except AnsibleFailJson as e: fail_json_iterations.append("[%d] fail_json message: %s\noptions:\n%s" % (i, str(e), json.dumps(options, sort_keys=True, indent=4, separators=(',', ': ')))) diff --git a/tests/unit/plugins/connection/test_docker.py b/tests/unit/plugins/connection/test_docker.py index 484134d63d..b1c55d4bbd 100644 --- a/tests/unit/plugins/connection/test_docker.py +++ b/tests/unit/plugins/connection/test_docker.py @@ -41,21 +41,27 @@ class TestDockerConnectionClass(unittest.TestCase): def tearDown(self): pass - @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version', return_value=('false', 'garbage', '', 1)) - @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version', return_value=('docker version', '1.2.3', '', 0)) + @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version', + return_value=('false', 'garbage', '', 1)) + @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version', + return_value=('docker version', '1.2.3', '', 0)) def test_docker_connection_module_too_old(self, mock_new_docker_verison, mock_old_docker_version): self.assertRaisesRegexp(AnsibleError, '^docker connection type requires docker 1.3 or higher$', DockerConnection, self.play_context, self.in_stream, docker_command='/fake/docker') - @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version', return_value=('false', 'garbage', '', 1)) - @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version', return_value=('docker version', '1.3.4', '', 0)) + @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version', + return_value=('false', 'garbage', '', 1)) + @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version', + return_value=('docker version', '1.3.4', '', 0)) def test_docker_connection_module(self, mock_new_docker_verison, mock_old_docker_version): self.assertIsInstance(DockerConnection(self.play_context, self.in_stream, docker_command='/fake/docker'), DockerConnection) # old version and new version fail - @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version', return_value=('false', 'garbage', '', 1)) - @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version', return_value=('false', 'garbage', '', 1)) + @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._old_docker_version', + return_value=('false', 'garbage', '', 1)) + @mock.patch('ansible_collections.community.general.plugins.connection.docker.Connection._new_docker_version', + return_value=('false', 'garbage', '', 1)) def test_docker_connection_module_wrong_cmd(self, mock_new_docker_version, mock_old_docker_version): self.assertRaisesRegexp(AnsibleError, '^Docker version check (.*?) failed: ', DockerConnection, self.play_context, self.in_stream, docker_command='/fake/docker') diff --git a/tests/utils/shippable/shippable.sh b/tests/utils/shippable/shippable.sh index 3686e79470..63d7f1b3c5 100755 --- a/tests/utils/shippable/shippable.sh +++ b/tests/utils/shippable/shippable.sh @@ -43,24 +43,20 @@ ansible-galaxy -vvv collection install ansible.posix ansible-galaxy -vvv collection install community.crypto ansible-galaxy -vvv collection install ansible.netcommon ansible-galaxy -vvv collection install ovirt.ovirt_collection - -# unit tests -ansible-galaxy -vvv collection install community.kubernetes -ansible-galaxy -vvv collection install netbox.netbox -ansible-galaxy -vvv collection install netapp.ontap ansible-galaxy -vvv collection install cisco.mso -ansible-galaxy -vvv collection install cisco.meraki ansible-galaxy -vvv collection install cisco.intersight -ansible-galaxy -vvv collection install fortinet.fortios -ansible-galaxy -vvv collection install junipernetworks.junos -ansible-galaxy -vvv collection install cisco.aci -ansible-galaxy -vvv collection install google.cloud +ansible-galaxy -vvv collection install check_point.mgmt ansible-galaxy -vvv collection install community.kubernetes ansible-galaxy -vvv collection install f5networks.f5_modules -ansible-galaxy -vvv collection install check_point.mgmt +ansible-galaxy -vvv collection install fortinet.fortios +ansible-galaxy -vvv collection install cisco.aci +ansible-galaxy -vvv collection install google.cloud +ansible-galaxy -vvv collection install netapp.ontap + +# unit tests +ansible-galaxy -vvv collection install cisco.meraki +ansible-galaxy -vvv collection install junipernetworks.junos -# Needed until https://github.com/ansible/ansible/issues/68415 is fixed: -chmod -R a+rX "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections" # END: HACK export PYTHONIOENCODING='utf-8'