From d312c2aed768d398708244a8b6523f7f4d2a78d9 Mon Sep 17 00:00:00 2001 From: Tim Rupp Date: Fri, 11 May 2018 12:59:29 -0700 Subject: [PATCH] Various bigiq fixes (#40024) Udpdating coding conventions --- .../modules/network/f5/bigiq_regkey_license.py | 12 ++---------- lib/ansible/modules/network/f5/bigiq_regkey_pool.py | 11 +---------- test/sanity/validate-modules/ignore.txt | 1 - .../modules/network/f5/test_bigiq_regkey_license.py | 8 ++++---- .../modules/network/f5/test_bigiq_regkey_pool.py | 8 ++++---- 5 files changed, 11 insertions(+), 29 deletions(-) diff --git a/lib/ansible/modules/network/f5/bigiq_regkey_license.py b/lib/ansible/modules/network/f5/bigiq_regkey_license.py index 8d312f2d4b..e8d1be1a5b 100644 --- a/lib/ansible/modules/network/f5/bigiq_regkey_license.py +++ b/lib/ansible/modules/network/f5/bigiq_regkey_license.py @@ -18,7 +18,7 @@ module: bigiq_regkey_license short_description: Manages licenses in a BIG-IQ registration key pool description: - Manages licenses in a BIG-IQ registration key pool. -version_added: "2.5" +version_added: 2.5 options: regkey_pool: description: @@ -40,6 +40,7 @@ options: - A key that signifies that you accept the F5 EULA for this license. - A copy of the EULA can be found here https://askf5.f5.com/csp/article/K12902 - This is required when C(state) is C(present). + type: bool state: description: - The state of the regkey license in the pool on the system. @@ -91,30 +92,21 @@ import time from ansible.module_utils.basic import AnsibleModule -HAS_DEVEL_IMPORTS = False - try: - # Sideband repository used for dev from library.module_utils.network.f5.bigiq import HAS_F5SDK from library.module_utils.network.f5.bigiq import F5Client from library.module_utils.network.f5.common import F5ModuleError from library.module_utils.network.f5.common import AnsibleF5Parameters - from library.module_utils.network.f5.common import cleanup_tokens - from library.module_utils.network.f5.common import fqdn_name from library.module_utils.network.f5.common import f5_argument_spec try: from library.module_utils.network.f5.common import iControlUnexpectedHTTPError except ImportError: HAS_F5SDK = False - HAS_DEVEL_IMPORTS = True except ImportError: - # Upstream Ansible from ansible.module_utils.network.f5.bigiq import HAS_F5SDK from ansible.module_utils.network.f5.bigiq import F5Client from ansible.module_utils.network.f5.common import F5ModuleError from ansible.module_utils.network.f5.common import AnsibleF5Parameters - from ansible.module_utils.network.f5.common import cleanup_tokens - from ansible.module_utils.network.f5.common import fqdn_name from ansible.module_utils.network.f5.common import f5_argument_spec try: from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError diff --git a/lib/ansible/modules/network/f5/bigiq_regkey_pool.py b/lib/ansible/modules/network/f5/bigiq_regkey_pool.py index 07c79243ab..8b7b142d90 100644 --- a/lib/ansible/modules/network/f5/bigiq_regkey_pool.py +++ b/lib/ansible/modules/network/f5/bigiq_regkey_pool.py @@ -20,7 +20,7 @@ description: - Manages registration key (regkey) pools on a BIG-IQ. These pools function as a container in-which you will add lists of registration keys. To add registration keys, use the C(bigiq_regkey_license) module. -version_added: "2.5" +version_added: 2.5 options: name: description: @@ -71,30 +71,21 @@ description: from ansible.module_utils.basic import AnsibleModule -HAS_DEVEL_IMPORTS = False - try: - # Sideband repository used for dev from library.module_utils.network.f5.bigiq import HAS_F5SDK from library.module_utils.network.f5.bigiq import F5Client from library.module_utils.network.f5.common import F5ModuleError from library.module_utils.network.f5.common import AnsibleF5Parameters - from library.module_utils.network.f5.common import cleanup_tokens - from library.module_utils.network.f5.common import fqdn_name from library.module_utils.network.f5.common import f5_argument_spec try: from library.module_utils.network.f5.common import iControlUnexpectedHTTPError except ImportError: HAS_F5SDK = False - HAS_DEVEL_IMPORTS = True except ImportError: - # Upstream Ansible from ansible.module_utils.network.f5.bigiq import HAS_F5SDK from ansible.module_utils.network.f5.bigiq import F5Client from ansible.module_utils.network.f5.common import F5ModuleError from ansible.module_utils.network.f5.common import AnsibleF5Parameters - from ansible.module_utils.network.f5.common import cleanup_tokens - from ansible.module_utils.network.f5.common import fqdn_name from ansible.module_utils.network.f5.common import f5_argument_spec try: from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError diff --git a/test/sanity/validate-modules/ignore.txt b/test/sanity/validate-modules/ignore.txt index 9f5c7a28bc..281cbab555 100644 --- a/test/sanity/validate-modules/ignore.txt +++ b/test/sanity/validate-modules/ignore.txt @@ -951,7 +951,6 @@ lib/ansible/modules/network/f5/bigip_profile_client_ssl.py E324 lib/ansible/modules/network/f5/bigip_selfip.py E324 lib/ansible/modules/network/f5/bigip_sys_global.py E326 lib/ansible/modules/network/f5/bigip_virtual_server.py E326 -lib/ansible/modules/network/f5/bigiq_regkey_license.py E325 lib/ansible/modules/network/fortimanager/fmgr_script.py E324 lib/ansible/modules/network/fortios/fortios_address.py E324 lib/ansible/modules/network/illumos/dladm_iptun.py E325 diff --git a/test/units/modules/network/f5/test_bigiq_regkey_license.py b/test/units/modules/network/f5/test_bigiq_regkey_license.py index 08575d09a7..ca5f531f9c 100644 --- a/test/units/modules/network/f5/test_bigiq_regkey_license.py +++ b/test/units/modules/network/f5/test_bigiq_regkey_license.py @@ -21,10 +21,10 @@ from ansible.compat.tests.mock import patch from ansible.module_utils.basic import AnsibleModule try: - from library.bigiq_regkey_license import ModuleParameters - from library.bigiq_regkey_license import ApiParameters - from library.bigiq_regkey_license import ModuleManager - from library.bigiq_regkey_license import ArgumentSpec + from library.modules.bigiq_regkey_license import ModuleParameters + from library.modules.bigiq_regkey_license import ApiParameters + from library.modules.bigiq_regkey_license import ModuleManager + from library.modules.bigiq_regkey_license import ArgumentSpec from library.module_utils.network.f5.common import F5ModuleError from library.module_utils.network.f5.common import iControlUnexpectedHTTPError from test.unit.modules.utils import set_module_args diff --git a/test/units/modules/network/f5/test_bigiq_regkey_pool.py b/test/units/modules/network/f5/test_bigiq_regkey_pool.py index 555b4e2601..e323ebd803 100644 --- a/test/units/modules/network/f5/test_bigiq_regkey_pool.py +++ b/test/units/modules/network/f5/test_bigiq_regkey_pool.py @@ -21,10 +21,10 @@ from ansible.compat.tests.mock import patch from ansible.module_utils.basic import AnsibleModule try: - from library.bigiq_regkey_pool import ModuleParameters - from library.bigiq_regkey_pool import ApiParameters - from library.bigiq_regkey_pool import ModuleManager - from library.bigiq_regkey_pool import ArgumentSpec + from library.modules.bigiq_regkey_pool import ModuleParameters + from library.modules.bigiq_regkey_pool import ApiParameters + from library.modules.bigiq_regkey_pool import ModuleManager + from library.modules.bigiq_regkey_pool import ArgumentSpec from library.module_utils.network.f5.common import F5ModuleError from library.module_utils.network.f5.common import iControlUnexpectedHTTPError from test.unit.modules.utils import set_module_args