From e6d586f7037f72824e3397f8465895596e881070 Mon Sep 17 00:00:00 2001 From: Tim Rupp Date: Mon, 19 Nov 2018 13:44:20 -0800 Subject: [PATCH] Change port to allow strings too (#48899) The port technically supports an asterisk, but the argument spec was requiring integers only. --- .../network/f5/bigip_gtm_monitor_bigip.py | 2 +- .../network/f5/bigip_gtm_monitor_external.py | 2 +- .../network/f5/bigip_gtm_monitor_firepass.py | 2 +- .../network/f5/bigip_gtm_monitor_http.py | 2 +- .../network/f5/bigip_gtm_monitor_https.py | 2 +- .../network/f5/bigip_gtm_monitor_tcp.py | 2 +- .../f5/bigip_gtm_monitor_tcp_half_open.py | 2 +- .../modules/network/f5/bigip_monitor_dns.py | 2 +- .../network/f5/bigip_monitor_external.py | 2 +- .../modules/network/f5/bigip_monitor_http.py | 2 +- .../modules/network/f5/bigip_monitor_https.py | 4 ++-- .../modules/network/f5/bigip_monitor_ldap.py | 2 +- .../modules/network/f5/bigip_monitor_tcp.py | 2 +- .../network/f5/bigip_monitor_tcp_echo.py | 2 -- .../network/f5/bigip_monitor_tcp_half_open.py | 2 +- .../modules/network/f5/bigip_monitor_udp.py | 2 +- .../f5/test_bigip_gtm_monitor_bigip.py | 22 ++++++++--------- .../f5/test_bigip_gtm_monitor_external.py | 22 ++++++++--------- .../f5/test_bigip_gtm_monitor_firepass.py | 22 ++++++++--------- .../network/f5/test_bigip_gtm_monitor_http.py | 22 ++++++++--------- .../f5/test_bigip_gtm_monitor_https.py | 22 ++++++++--------- .../network/f5/test_bigip_gtm_monitor_tcp.py | 22 ++++++++--------- .../test_bigip_gtm_monitor_tcp_half_open.py | 22 ++++++++--------- .../network/f5/test_bigip_monitor_dns.py | 22 ++++++++--------- .../network/f5/test_bigip_monitor_external.py | 24 ++++++++----------- .../network/f5/test_bigip_monitor_http.py | 22 ++++++++--------- .../network/f5/test_bigip_monitor_https.py | 22 ++++++++--------- .../network/f5/test_bigip_monitor_ldap.py | 22 ++++++++--------- .../network/f5/test_bigip_monitor_snmp_dca.py | 20 +++++++--------- .../network/f5/test_bigip_monitor_tcp.py | 22 ++++++++--------- .../network/f5/test_bigip_monitor_tcp_echo.py | 22 ++++++++--------- .../f5/test_bigip_monitor_tcp_half_open.py | 22 ++++++++--------- .../network/f5/test_bigip_monitor_udp.py | 22 ++++++++--------- 33 files changed, 185 insertions(+), 223 deletions(-) diff --git a/lib/ansible/modules/network/f5/bigip_gtm_monitor_bigip.py b/lib/ansible/modules/network/f5/bigip_gtm_monitor_bigip.py index 9e571062556..d6006a5bfab 100644 --- a/lib/ansible/modules/network/f5/bigip_gtm_monitor_bigip.py +++ b/lib/ansible/modules/network/f5/bigip_gtm_monitor_bigip.py @@ -614,7 +614,7 @@ class ArgumentSpec(object): name=dict(required=True), parent=dict(default='/Common/bigip'), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), ignore_down_response=dict(type='bool'), diff --git a/lib/ansible/modules/network/f5/bigip_gtm_monitor_external.py b/lib/ansible/modules/network/f5/bigip_gtm_monitor_external.py index ff979a0b816..db83c210d14 100644 --- a/lib/ansible/modules/network/f5/bigip_gtm_monitor_external.py +++ b/lib/ansible/modules/network/f5/bigip_gtm_monitor_external.py @@ -659,7 +659,7 @@ class ArgumentSpec(object): parent=dict(default='/Common/external'), arguments=dict(), ip=dict(), - port=dict(type='int'), + port=dict(), external_program=dict(), interval=dict(type='int'), timeout=dict(type='int'), diff --git a/lib/ansible/modules/network/f5/bigip_gtm_monitor_firepass.py b/lib/ansible/modules/network/f5/bigip_gtm_monitor_firepass.py index 7ca7682b34e..da7857cab7c 100644 --- a/lib/ansible/modules/network/f5/bigip_gtm_monitor_firepass.py +++ b/lib/ansible/modules/network/f5/bigip_gtm_monitor_firepass.py @@ -733,7 +733,7 @@ class ArgumentSpec(object): name=dict(required=True), parent=dict(default='/Common/firepass_gtm'), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), ignore_down_response=dict(type='bool'), diff --git a/lib/ansible/modules/network/f5/bigip_gtm_monitor_http.py b/lib/ansible/modules/network/f5/bigip_gtm_monitor_http.py index c1f21c2b41c..4eb2a301124 100644 --- a/lib/ansible/modules/network/f5/bigip_gtm_monitor_http.py +++ b/lib/ansible/modules/network/f5/bigip_gtm_monitor_http.py @@ -779,7 +779,7 @@ class ArgumentSpec(object): send=dict(), receive=dict(), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), ignore_down_response=dict(type='bool'), diff --git a/lib/ansible/modules/network/f5/bigip_gtm_monitor_https.py b/lib/ansible/modules/network/f5/bigip_gtm_monitor_https.py index a5ac45903c0..1e9e4e01c18 100644 --- a/lib/ansible/modules/network/f5/bigip_gtm_monitor_https.py +++ b/lib/ansible/modules/network/f5/bigip_gtm_monitor_https.py @@ -895,7 +895,7 @@ class ArgumentSpec(object): send=dict(), receive=dict(), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), ignore_down_response=dict(type='bool'), diff --git a/lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp.py b/lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp.py index 948f781036b..1c9a09ff8d2 100644 --- a/lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp.py +++ b/lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp.py @@ -747,7 +747,7 @@ class ArgumentSpec(object): send=dict(), receive=dict(), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), ignore_down_response=dict(type='bool'), diff --git a/lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.py b/lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.py index 3987aecda6c..fed812aa3dd 100644 --- a/lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.py +++ b/lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.py @@ -654,7 +654,7 @@ class ArgumentSpec(object): name=dict(required=True), parent=dict(default='/Common/tcp_half_open'), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), probe_interval=dict(type='int'), diff --git a/lib/ansible/modules/network/f5/bigip_monitor_dns.py b/lib/ansible/modules/network/f5/bigip_monitor_dns.py index e74c04d3a56..8736d3235c1 100644 --- a/lib/ansible/modules/network/f5/bigip_monitor_dns.py +++ b/lib/ansible/modules/network/f5/bigip_monitor_dns.py @@ -960,7 +960,7 @@ class ArgumentSpec(object): receive=dict(), ip=dict(), description=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), manual_resume=dict(type='bool'), diff --git a/lib/ansible/modules/network/f5/bigip_monitor_external.py b/lib/ansible/modules/network/f5/bigip_monitor_external.py index 3a16ecb55fd..2cea046303e 100644 --- a/lib/ansible/modules/network/f5/bigip_monitor_external.py +++ b/lib/ansible/modules/network/f5/bigip_monitor_external.py @@ -696,7 +696,7 @@ class ArgumentSpec(object): description=dict(), arguments=dict(), ip=dict(), - port=dict(type='int'), + port=dict(), external_program=dict(), interval=dict(type='int'), timeout=dict(type='int'), diff --git a/lib/ansible/modules/network/f5/bigip_monitor_http.py b/lib/ansible/modules/network/f5/bigip_monitor_http.py index ab5e6a441e7..f31995864c4 100644 --- a/lib/ansible/modules/network/f5/bigip_monitor_http.py +++ b/lib/ansible/modules/network/f5/bigip_monitor_http.py @@ -698,7 +698,7 @@ class ArgumentSpec(object): receive=dict(), receive_disable=dict(required=False), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), reverse=dict(type='bool'), timeout=dict(type='int'), diff --git a/lib/ansible/modules/network/f5/bigip_monitor_https.py b/lib/ansible/modules/network/f5/bigip_monitor_https.py index d79d5d11ea7..9c08adef268 100644 --- a/lib/ansible/modules/network/f5/bigip_monitor_https.py +++ b/lib/ansible/modules/network/f5/bigip_monitor_https.py @@ -56,7 +56,7 @@ options: - Port address part of the IP/port definition. If this parameter is not provided when creating a new monitor, then the default value will be '*'. Note that if specifying an IP address, a value between 1 and 65535 - must be specified + must be specified. interval: description: - The interval specifying how frequently the monitor instance of this @@ -667,7 +667,7 @@ class ArgumentSpec(object): receive=dict(), receive_disable=dict(required=False), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), time_until_up=dict(type='int'), diff --git a/lib/ansible/modules/network/f5/bigip_monitor_ldap.py b/lib/ansible/modules/network/f5/bigip_monitor_ldap.py index f6e617cc09b..a505faa0a6e 100644 --- a/lib/ansible/modules/network/f5/bigip_monitor_ldap.py +++ b/lib/ansible/modules/network/f5/bigip_monitor_ldap.py @@ -756,7 +756,7 @@ class ArgumentSpec(object): parent=dict(default='/Common/ldap'), ip=dict(), description=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), target_username=dict(), diff --git a/lib/ansible/modules/network/f5/bigip_monitor_tcp.py b/lib/ansible/modules/network/f5/bigip_monitor_tcp.py index 172c8033e51..f7ab8cfd022 100644 --- a/lib/ansible/modules/network/f5/bigip_monitor_tcp.py +++ b/lib/ansible/modules/network/f5/bigip_monitor_tcp.py @@ -621,7 +621,7 @@ class ArgumentSpec(object): send=dict(), receive=dict(), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), time_until_up=dict(type='int'), diff --git a/lib/ansible/modules/network/f5/bigip_monitor_tcp_echo.py b/lib/ansible/modules/network/f5/bigip_monitor_tcp_echo.py index 4b225592a91..82a7bba69d1 100644 --- a/lib/ansible/modules/network/f5/bigip_monitor_tcp_echo.py +++ b/lib/ansible/modules/network/f5/bigip_monitor_tcp_echo.py @@ -38,8 +38,6 @@ options: - IP address part of the IP/port definition. If this parameter is not provided when creating a new monitor, then the default value will be '*'. - - If this value is an IP address, and the C(type) is C(tcp) (the default), - then a C(port) number must be specified. interval: description: - The interval specifying how frequently the monitor instance of this diff --git a/lib/ansible/modules/network/f5/bigip_monitor_tcp_half_open.py b/lib/ansible/modules/network/f5/bigip_monitor_tcp_half_open.py index d85942d0ea7..67fe7a1e598 100644 --- a/lib/ansible/modules/network/f5/bigip_monitor_tcp_half_open.py +++ b/lib/ansible/modules/network/f5/bigip_monitor_tcp_half_open.py @@ -606,7 +606,7 @@ class ArgumentSpec(object): parent=dict(default='/Common/tcp_half_open'), description=dict(), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), time_until_up=dict(type='int'), diff --git a/lib/ansible/modules/network/f5/bigip_monitor_udp.py b/lib/ansible/modules/network/f5/bigip_monitor_udp.py index f428f6440d3..1cecaec5d76 100644 --- a/lib/ansible/modules/network/f5/bigip_monitor_udp.py +++ b/lib/ansible/modules/network/f5/bigip_monitor_udp.py @@ -616,7 +616,7 @@ class ArgumentSpec(object): receive=dict(), receive_disable=dict(required=False), ip=dict(), - port=dict(type='int'), + port=dict(), interval=dict(type='int'), timeout=dict(type='int'), time_until_up=dict(type='int'), diff --git a/test/units/modules/network/f5/test_bigip_gtm_monitor_bigip.py b/test/units/modules/network/f5/test_bigip_gtm_monitor_bigip.py index a49d952fae8..f65aeadb419 100644 --- a/test/units/modules/network/f5/test_bigip_gtm_monitor_bigip.py +++ b/test/units/modules/network/f5/test_bigip_gtm_monitor_bigip.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_gtm_monitor_bigip import ApiParameters - from ansible.modules.network.f5.bigip_gtm_monitor_bigip import ModuleParameters - from ansible.modules.network.f5.bigip_gtm_monitor_bigip import ModuleManager - from ansible.modules.network.f5.bigip_gtm_monitor_bigip import ArgumentSpec + from ansible.modules.network.f5.bigip_gtm_monitor_bigip import ApiParameters + from ansible.modules.network.f5.bigip_gtm_monitor_bigip import ModuleParameters + from ansible.modules.network.f5.bigip_gtm_monitor_bigip import ModuleManager + from ansible.modules.network.f5.bigip_gtm_monitor_bigip import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_gtm_monitor_external.py b/test/units/modules/network/f5/test_bigip_gtm_monitor_external.py index bae095b7325..208d256bed1 100644 --- a/test/units/modules/network/f5/test_bigip_gtm_monitor_external.py +++ b/test/units/modules/network/f5/test_bigip_gtm_monitor_external.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_gtm_monitor_external import ApiParameters - from ansible.modules.network.f5.bigip_gtm_monitor_external import ModuleParameters - from ansible.modules.network.f5.bigip_gtm_monitor_external import ModuleManager - from ansible.modules.network.f5.bigip_gtm_monitor_external import ArgumentSpec + from ansible.modules.network.f5.bigip_gtm_monitor_external import ApiParameters + from ansible.modules.network.f5.bigip_gtm_monitor_external import ModuleParameters + from ansible.modules.network.f5.bigip_gtm_monitor_external import ModuleManager + from ansible.modules.network.f5.bigip_gtm_monitor_external import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_gtm_monitor_firepass.py b/test/units/modules/network/f5/test_bigip_gtm_monitor_firepass.py index ac3dfeedf18..950c448f85f 100644 --- a/test/units/modules/network/f5/test_bigip_gtm_monitor_firepass.py +++ b/test/units/modules/network/f5/test_bigip_gtm_monitor_firepass.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_gtm_monitor_firepass import ApiParameters - from ansible.modules.network.f5.bigip_gtm_monitor_firepass import ModuleParameters - from ansible.modules.network.f5.bigip_gtm_monitor_firepass import ModuleManager - from ansible.modules.network.f5.bigip_gtm_monitor_firepass import ArgumentSpec + from ansible.modules.network.f5.bigip_gtm_monitor_firepass import ApiParameters + from ansible.modules.network.f5.bigip_gtm_monitor_firepass import ModuleParameters + from ansible.modules.network.f5.bigip_gtm_monitor_firepass import ModuleManager + from ansible.modules.network.f5.bigip_gtm_monitor_firepass import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_gtm_monitor_http.py b/test/units/modules/network/f5/test_bigip_gtm_monitor_http.py index c759169e7cc..371fd216b57 100644 --- a/test/units/modules/network/f5/test_bigip_gtm_monitor_http.py +++ b/test/units/modules/network/f5/test_bigip_gtm_monitor_http.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_gtm_monitor_http import ApiParameters - from ansible.modules.network.f5.bigip_gtm_monitor_http import ModuleParameters - from ansible.modules.network.f5.bigip_gtm_monitor_http import ModuleManager - from ansible.modules.network.f5.bigip_gtm_monitor_http import ArgumentSpec + from ansible.modules.network.f5.bigip_gtm_monitor_http import ApiParameters + from ansible.modules.network.f5.bigip_gtm_monitor_http import ModuleParameters + from ansible.modules.network.f5.bigip_gtm_monitor_http import ModuleManager + from ansible.modules.network.f5.bigip_gtm_monitor_http import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_gtm_monitor_https.py b/test/units/modules/network/f5/test_bigip_gtm_monitor_https.py index 7ea1f442e72..25f28e0ebe0 100644 --- a/test/units/modules/network/f5/test_bigip_gtm_monitor_https.py +++ b/test/units/modules/network/f5/test_bigip_gtm_monitor_https.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_gtm_monitor_https import ApiParameters - from ansible.modules.network.f5.bigip_gtm_monitor_https import ModuleParameters - from ansible.modules.network.f5.bigip_gtm_monitor_https import ModuleManager - from ansible.modules.network.f5.bigip_gtm_monitor_https import ArgumentSpec + from ansible.modules.network.f5.bigip_gtm_monitor_https import ApiParameters + from ansible.modules.network.f5.bigip_gtm_monitor_https import ModuleParameters + from ansible.modules.network.f5.bigip_gtm_monitor_https import ModuleManager + from ansible.modules.network.f5.bigip_gtm_monitor_https import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_gtm_monitor_tcp.py b/test/units/modules/network/f5/test_bigip_gtm_monitor_tcp.py index 59a3be7c6b1..d1674cd88ae 100644 --- a/test/units/modules/network/f5/test_bigip_gtm_monitor_tcp.py +++ b/test/units/modules/network/f5/test_bigip_gtm_monitor_tcp.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_gtm_monitor_tcp import ApiParameters - from ansible.modules.network.f5.bigip_gtm_monitor_tcp import ModuleParameters - from ansible.modules.network.f5.bigip_gtm_monitor_tcp import ModuleManager - from ansible.modules.network.f5.bigip_gtm_monitor_tcp import ArgumentSpec + from ansible.modules.network.f5.bigip_gtm_monitor_tcp import ApiParameters + from ansible.modules.network.f5.bigip_gtm_monitor_tcp import ModuleParameters + from ansible.modules.network.f5.bigip_gtm_monitor_tcp import ModuleManager + from ansible.modules.network.f5.bigip_gtm_monitor_tcp import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_gtm_monitor_tcp_half_open.py b/test/units/modules/network/f5/test_bigip_gtm_monitor_tcp_half_open.py index ee728f43c47..4dd2f246e7b 100644 --- a/test/units/modules/network/f5/test_bigip_gtm_monitor_tcp_half_open.py +++ b/test/units/modules/network/f5/test_bigip_gtm_monitor_tcp_half_open.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_gtm_monitor_tcp_half_open import ApiParameters - from ansible.modules.network.f5.bigip_gtm_monitor_tcp_half_open import ModuleParameters - from ansible.modules.network.f5.bigip_gtm_monitor_tcp_half_open import ModuleManager - from ansible.modules.network.f5.bigip_gtm_monitor_tcp_half_open import ArgumentSpec + from ansible.modules.network.f5.bigip_gtm_monitor_tcp_half_open import ApiParameters + from ansible.modules.network.f5.bigip_gtm_monitor_tcp_half_open import ModuleParameters + from ansible.modules.network.f5.bigip_gtm_monitor_tcp_half_open import ModuleManager + from ansible.modules.network.f5.bigip_gtm_monitor_tcp_half_open import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_monitor_dns.py b/test/units/modules/network/f5/test_bigip_monitor_dns.py index 45837fce53a..2ead54e40b2 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_dns.py +++ b/test/units/modules/network/f5/test_bigip_monitor_dns.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_dns import ApiParameters - from ansible.modules.network.f5.bigip_monitor_dns import ModuleParameters - from ansible.modules.network.f5.bigip_monitor_dns import ModuleManager - from ansible.modules.network.f5.bigip_monitor_dns import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_dns import ApiParameters + from ansible.modules.network.f5.bigip_monitor_dns import ModuleParameters + from ansible.modules.network.f5.bigip_monitor_dns import ModuleManager + from ansible.modules.network.f5.bigip_monitor_dns import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_monitor_external.py b/test/units/modules/network/f5/test_bigip_monitor_external.py index 64286148aae..fb7d3027a54 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_external.py +++ b/test/units/modules/network/f5/test_bigip_monitor_external.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_external import ApiParameters - from ansible.modules.network.f5.bigip_monitor_external import ModuleParameters - from ansible.modules.network.f5.bigip_monitor_external import ModuleManager - from ansible.modules.network.f5.bigip_monitor_external import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_external import ApiParameters + from ansible.modules.network.f5.bigip_monitor_external import ModuleParameters + from ansible.modules.network.f5.bigip_monitor_external import ModuleManager + from ansible.modules.network.f5.bigip_monitor_external import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} @@ -89,8 +87,6 @@ class TestParameters(unittest.TestCase): assert p.timeout == 30 -@patch('ansible.module_utils.f5_utils.AnsibleF5Client._get_mgmt_root', - return_value=True) class TestManager(unittest.TestCase): def setUp(self): diff --git a/test/units/modules/network/f5/test_bigip_monitor_http.py b/test/units/modules/network/f5/test_bigip_monitor_http.py index 0be84a6c8e7..8654b621bb2 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_http.py +++ b/test/units/modules/network/f5/test_bigip_monitor_http.py @@ -31,21 +31,19 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_http import Parameters - from ansible.modules.network.f5.bigip_monitor_http import ModuleManager - from ansible.modules.network.f5.bigip_monitor_http import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_http import Parameters + from ansible.modules.network.f5.bigip_monitor_http import ModuleManager + from ansible.modules.network.f5.bigip_monitor_http import ArgumentSpec - from ansible.module_utils.network.f5.common import F5ModuleError + from ansible.module_utils.network.f5.common import F5ModuleError - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_monitor_https.py b/test/units/modules/network/f5/test_bigip_monitor_https.py index 463951fdda1..5f16e69ffad 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_https.py +++ b/test/units/modules/network/f5/test_bigip_monitor_https.py @@ -31,21 +31,19 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_https import Parameters - from ansible.modules.network.f5.bigip_monitor_https import ModuleManager - from ansible.modules.network.f5.bigip_monitor_https import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_https import Parameters + from ansible.modules.network.f5.bigip_monitor_https import ModuleManager + from ansible.modules.network.f5.bigip_monitor_https import ArgumentSpec - from ansible.module_utils.network.f5.common import F5ModuleError + from ansible.module_utils.network.f5.common import F5ModuleError - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_monitor_ldap.py b/test/units/modules/network/f5/test_bigip_monitor_ldap.py index c6732d6a127..6c41d0e867a 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_ldap.py +++ b/test/units/modules/network/f5/test_bigip_monitor_ldap.py @@ -29,20 +29,18 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_ldap import ApiParameters - from ansible.modules.network.f5.bigip_monitor_ldap import ModuleParameters - from ansible.modules.network.f5.bigip_monitor_ldap import ModuleManager - from ansible.modules.network.f5.bigip_monitor_ldap import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_ldap import ApiParameters + from ansible.modules.network.f5.bigip_monitor_ldap import ModuleParameters + from ansible.modules.network.f5.bigip_monitor_ldap import ModuleManager + from ansible.modules.network.f5.bigip_monitor_ldap import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_monitor_snmp_dca.py b/test/units/modules/network/f5/test_bigip_monitor_snmp_dca.py index 05a1973486b..1df0891b10f 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_snmp_dca.py +++ b/test/units/modules/network/f5/test_bigip_monitor_snmp_dca.py @@ -28,19 +28,17 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_snmp_dca import Parameters - from ansible.modules.network.f5.bigip_monitor_snmp_dca import ModuleManager - from ansible.modules.network.f5.bigip_monitor_snmp_dca import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_snmp_dca import Parameters + from ansible.modules.network.f5.bigip_monitor_snmp_dca import ModuleManager + from ansible.modules.network.f5.bigip_monitor_snmp_dca import ArgumentSpec - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_monitor_tcp.py b/test/units/modules/network/f5/test_bigip_monitor_tcp.py index 4396f50bdcc..d21d9543339 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_tcp.py +++ b/test/units/modules/network/f5/test_bigip_monitor_tcp.py @@ -31,21 +31,19 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_tcp import Parameters - from ansible.modules.network.f5.bigip_monitor_tcp import ModuleManager - from ansible.modules.network.f5.bigip_monitor_tcp import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_tcp import Parameters + from ansible.modules.network.f5.bigip_monitor_tcp import ModuleManager + from ansible.modules.network.f5.bigip_monitor_tcp import ArgumentSpec - from ansible.module_utils.network.f5.common import F5ModuleError + from ansible.module_utils.network.f5.common import F5ModuleError - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py b/test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py index 6e56dceb934..ec68beee9af 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py +++ b/test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py @@ -31,21 +31,19 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_tcp_echo import Parameters - from ansible.modules.network.f5.bigip_monitor_tcp_echo import ModuleManager - from ansible.modules.network.f5.bigip_monitor_tcp_echo import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_tcp_echo import Parameters + from ansible.modules.network.f5.bigip_monitor_tcp_echo import ModuleManager + from ansible.modules.network.f5.bigip_monitor_tcp_echo import ArgumentSpec - from ansible.module_utils.network.f5.common import F5ModuleError + from ansible.module_utils.network.f5.common import F5ModuleError - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_monitor_tcp_half_open.py b/test/units/modules/network/f5/test_bigip_monitor_tcp_half_open.py index fb661cf81ce..6b2e0227790 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_tcp_half_open.py +++ b/test/units/modules/network/f5/test_bigip_monitor_tcp_half_open.py @@ -31,21 +31,19 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_tcp_half_open import Parameters - from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ModuleManager - from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_tcp_half_open import Parameters + from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ModuleManager + from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ArgumentSpec - from ansible.module_utils.network.f5.common import F5ModuleError + from ansible.module_utils.network.f5.common import F5ModuleError - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} diff --git a/test/units/modules/network/f5/test_bigip_monitor_udp.py b/test/units/modules/network/f5/test_bigip_monitor_udp.py index 559b984d5a6..4c7fe3b4d78 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_udp.py +++ b/test/units/modules/network/f5/test_bigip_monitor_udp.py @@ -31,21 +31,19 @@ try: from test.units.modules.utils import set_module_args except ImportError: - try: - from ansible.modules.network.f5.bigip_monitor_udp import Parameters - from ansible.modules.network.f5.bigip_monitor_udp import ModuleManager - from ansible.modules.network.f5.bigip_monitor_udp import ArgumentSpec + from ansible.modules.network.f5.bigip_monitor_udp import Parameters + from ansible.modules.network.f5.bigip_monitor_udp import ModuleManager + from ansible.modules.network.f5.bigip_monitor_udp import ArgumentSpec - from ansible.module_utils.network.f5.common import F5ModuleError + from ansible.module_utils.network.f5.common import F5ModuleError - # Ansible 2.8 imports - from units.compat import unittest - from units.compat.mock import Mock - from units.compat.mock import patch + # Ansible 2.8 imports + from units.compat import unittest + from units.compat.mock import Mock + from units.compat.mock import patch + + from units.modules.utils import set_module_args - from units.modules.utils import set_module_args - except ImportError: - raise SkipTest("F5 Ansible modules require the f5-sdk Python library") fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {}