Fixes tcp monitors (#33494)

* Fixes tcp monitors

Formatting fixes and a missing default parent. This patch fixes
that.

* Fixes upstream errors
pull/33495/head
Tim Rupp 7 years ago committed by GitHub
parent 212340bf0c
commit bcda0db7db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,14 +4,18 @@
# Copyright (c) 2017 F5 Networks Inc. # Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
'supported_by': 'community'} 'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: bigip_monitor_tcp module: bigip_monitor_tcp
short_description: Manages F5 BIG-IP LTM tcp monitors. short_description: Manages F5 BIG-IP LTM tcp monitors
description: Manages F5 BIG-IP LTM tcp monitors via iControl SOAP API. description: Manages F5 BIG-IP LTM tcp monitors via iControl SOAP API.
version_added: "1.4" version_added: "1.4"
options: options:
@ -26,7 +30,7 @@ options:
- The parent template of this monitor template. Once this value has - The parent template of this monitor template. Once this value has
been set, it cannot be changed. By default, this value is the C(tcp) been set, it cannot be changed. By default, this value is the C(tcp)
parent on the C(Common) partition. parent on the C(Common) partition.
default: "/Common/tcp" default: /Common/tcp
send: send:
description: description:
- The send string for the monitor call. - The send string for the monitor call.
@ -45,7 +49,7 @@ options:
- The template type of this monitor template. - The template type of this monitor template.
- Deprecated in 2.4. Use one of the C(bigip_monitor_tcp_echo) or - Deprecated in 2.4. Use one of the C(bigip_monitor_tcp_echo) or
C(bigip_monitor_tcp_half_open) modules instead. C(bigip_monitor_tcp_half_open) modules instead.
default: 'tcp' default: tcp
choices: choices:
- tcp - tcp
- tcp_echo - tcp_echo
@ -82,6 +86,11 @@ options:
node to be marked up immediately after a valid response is received node to be marked up immediately after a valid response is received
from the node. If this parameter is not provided when creating from the node. If this parameter is not provided when creating
a new monitor, then the default value will be 0. a new monitor, then the default value will be 0.
partition:
description:
- Device partition to manage resources on.
default: Common
version_added: 2.5
notes: notes:
- Requires the f5-sdk Python package on the host. This is as easy as pip - Requires the f5-sdk Python package on the host. This is as easy as pip
install f5-sdk. install f5-sdk.
@ -93,70 +102,70 @@ author:
- Tim Rupp (@caphrim007) - Tim Rupp (@caphrim007)
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Create TCP Monitor - name: Create TCP Monitor
bigip_monitor_tcp: bigip_monitor_tcp:
state: "present" state: present
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
name: "my_tcp_monitor" name: my_tcp_monitor
type: "tcp" type: tcp
send: "tcp string to send" send: tcp string to send
receive: "tcp string to receive" receive: tcp string to receive
delegate_to: localhost delegate_to: localhost
- name: Remove TCP Monitor - name: Remove TCP Monitor
bigip_monitor_tcp: bigip_monitor_tcp:
state: "absent" state: absent
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
name: "my_tcp_monitor" name: my_tcp_monitor
delegate_to: localhost delegate_to: localhost
''' '''
RETURN = ''' RETURN = r'''
parent: parent:
description: New parent template of the monitor. description: New parent template of the monitor.
returned: changed returned: changed
type: string type: string
sample: "tcp" sample: tcp
send: send:
description: The new send string for this monitor. description: The new send string for this monitor.
returned: changed returned: changed
type: string type: string
sample: "tcp string to send" sample: tcp string to send
receive: receive:
description: The new receive string for this monitor. description: The new receive string for this monitor.
returned: changed returned: changed
type: string type: string
sample: "tcp string to receive" sample: tcp string to receive
ip: ip:
description: The new IP of IP/port definition. description: The new IP of IP/port definition.
returned: changed returned: changed
type: string type: string
sample: "10.12.13.14" sample: 10.12.13.14
port: port:
description: The new port of IP/port definition. description: The new port of IP/port definition.
returned: changed returned: changed
type: string type: string
sample: "admin@root.local" sample: admin@root.local
interval: interval:
description: The new interval in which to run the monitor check. description: The new interval in which to run the monitor check.
returned: changed returned: changed
type: int type: int
sample: 2 sample: 2
timeout: timeout:
description: The new timeout in which the remote system must respond to the monitor. description: The new timeout in which the remote system must respond to the monitor.
returned: changed returned: changed
type: int type: int
sample: 10 sample: 10
time_until_up: time_until_up:
description: The new time in which to mark a system as up after first successful response. description: The new time in which to mark a system as up after first successful response.
returned: changed returned: changed
type: int type: int
sample: 2 sample: 2
''' '''
import os import os
@ -171,8 +180,8 @@ from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import AnsibleF5Parameters from ansible.module_utils.f5_utils import AnsibleF5Parameters
from ansible.module_utils.f5_utils import HAS_F5SDK from ansible.module_utils.f5_utils import HAS_F5SDK
from ansible.module_utils.f5_utils import F5ModuleError from ansible.module_utils.f5_utils import F5ModuleError
from ansible.module_utils.f5_utils import iteritems from ansible.module_utils.six import iteritems
from ansible.module_utils.f5_utils import defaultdict from collections import defaultdict
try: try:
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
@ -909,7 +918,7 @@ class ArgumentSpec(object):
# Make this assume "tcp" in the partition specified. The user # Make this assume "tcp" in the partition specified. The user
# is required to specify the full path if they want to use a different # is required to specify the full path if they want to use a different
# partition. # partition.
parent=dict(), parent=dict(default='tcp'),
send=dict(), send=dict(),
receive=dict(), receive=dict(),

@ -4,15 +4,19 @@
# Copyright (c) 2017 F5 Networks Inc. # Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
'supported_by': 'community'} 'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: bigip_monitor_tcp_echo module: bigip_monitor_tcp_echo
short_description: Manages F5 BIG-IP LTM tcp monitors. short_description: Manages F5 BIG-IP LTM tcp echo monitors
description: Manages F5 BIG-IP LTM tcp monitors via iControl SOAP API. description: Manages F5 BIG-IP LTM tcp echo monitors.
version_added: "2.4" version_added: "2.4"
options: options:
name: name:
@ -24,9 +28,9 @@ options:
parent: parent:
description: description:
- The parent template of this monitor template. Once this value has - The parent template of this monitor template. Once this value has
been set, it cannot be changed. By default, this value is the C(tcp) been set, it cannot be changed. By default, this value is the C(tcp_echo)
parent on the C(Common) partition. parent on the C(Common) partition.
default: "/Common/tcp" default: /Common/tcp_echo
ip: ip:
description: description:
- IP address part of the IP/port definition. If this parameter is not - IP address part of the IP/port definition. If this parameter is not
@ -56,6 +60,11 @@ options:
node to be marked up immediately after a valid response is received node to be marked up immediately after a valid response is received
from the node. If this parameter is not provided when creating from the node. If this parameter is not provided when creating
a new monitor, then the default value will be 0. a new monitor, then the default value will be 0.
partition:
description:
- Device partition to manage resources on.
default: Common
version_added: 2.5
notes: notes:
- Requires the f5-sdk Python package on the host. This is as easy as pip - Requires the f5-sdk Python package on the host. This is as easy as pip
install f5-sdk. install f5-sdk.
@ -67,53 +76,53 @@ author:
- Tim Rupp (@caphrim007) - Tim Rupp (@caphrim007)
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Create TCP Echo Monitor - name: Create TCP Echo Monitor
bigip_monitor_tcp_echo: bigip_monitor_tcp_echo:
state: "present" state: present
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
ip: 10.10.10.10 ip: 10.10.10.10
password: "secret" password: secret
name: "my_tcp_monitor" name: my_tcp_monitor
delegate_to: localhost delegate_to: localhost
- name: Remove TCP Echo Monitor - name: Remove TCP Echo Monitor
bigip_monitor_tcp_echo: bigip_monitor_tcp_echo:
state: "absent" state: absent
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
name: "my_tcp_monitor" name: my_tcp_monitor
delegate_to: localhost delegate_to: localhost
''' '''
RETURN = ''' RETURN = r'''
parent: parent:
description: New parent template of the monitor. description: New parent template of the monitor.
returned: changed returned: changed
type: string type: string
sample: "tcp" sample: tcp
ip: ip:
description: The new IP of IP/port definition. description: The new IP of IP/port definition.
returned: changed returned: changed
type: string type: string
sample: "10.12.13.14" sample: 10.12.13.14
interval: interval:
description: The new interval in which to run the monitor check. description: The new interval in which to run the monitor check.
returned: changed returned: changed
type: int type: int
sample: 2 sample: 2
timeout: timeout:
description: The new timeout in which the remote system must respond to the monitor. description: The new timeout in which the remote system must respond to the monitor.
returned: changed returned: changed
type: int type: int
sample: 10 sample: 10
time_until_up: time_until_up:
description: The new time in which to mark a system as up after first successful response. description: The new time in which to mark a system as up after first successful response.
returned: changed returned: changed
type: int type: int
sample: 2 sample: 2
''' '''
import os import os
@ -128,8 +137,8 @@ from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import AnsibleF5Parameters from ansible.module_utils.f5_utils import AnsibleF5Parameters
from ansible.module_utils.f5_utils import HAS_F5SDK from ansible.module_utils.f5_utils import HAS_F5SDK
from ansible.module_utils.f5_utils import F5ModuleError from ansible.module_utils.f5_utils import F5ModuleError
from ansible.module_utils.f5_utils import iteritems from ansible.module_utils.six import iteritems
from ansible.module_utils.f5_utils import defaultdict from collections import defaultdict
try: try:
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
@ -477,7 +486,7 @@ class ArgumentSpec(object):
self.supports_check_mode = True self.supports_check_mode = True
self.argument_spec = dict( self.argument_spec = dict(
name=dict(required=True), name=dict(required=True),
parent=dict(), parent=dict(default='tcp_echo'),
ip=dict(), ip=dict(),
interval=dict(type='int'), interval=dict(type='int'),
timeout=dict(type='int'), timeout=dict(type='int'),

@ -4,15 +4,19 @@
# Copyright (c) 2017 F5 Networks Inc. # Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
'supported_by': 'community'} 'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: bigip_monitor_tcp_half_open module: bigip_monitor_tcp_half_open
short_description: Manages F5 BIG-IP LTM tcp monitors. short_description: Manages F5 BIG-IP LTM tcp half-open monitors
description: Manages F5 BIG-IP LTM tcp monitors via iControl SOAP API. description: Manages F5 BIG-IP LTM tcp half-open monitors.
version_added: "2.4" version_added: "2.4"
options: options:
name: name:
@ -24,9 +28,9 @@ options:
parent: parent:
description: description:
- The parent template of this monitor template. Once this value has - The parent template of this monitor template. Once this value has
been set, it cannot be changed. By default, this value is the C(tcp) been set, it cannot be changed. By default, this value is the C(tcp_half_open)
parent on the C(Common) partition. parent on the C(Common) partition.
default: "/Common/tcp" default: "/Common/tcp_half_open"
ip: ip:
description: description:
- IP address part of the IP/port definition. If this parameter is not - IP address part of the IP/port definition. If this parameter is not
@ -34,6 +38,13 @@ options:
'*'. '*'.
- If this value is an IP address, and the C(type) is C(tcp) (the default), - If this value is an IP address, and the C(type) is C(tcp) (the default),
then a C(port) number must be specified. then a C(port) number must be specified.
port:
description:
- 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
version_added: 2.5
interval: interval:
description: description:
- The interval specifying how frequently the monitor instance of this - The interval specifying how frequently the monitor instance of this
@ -56,6 +67,11 @@ options:
node to be marked up immediately after a valid response is received node to be marked up immediately after a valid response is received
from the node. If this parameter is not provided when creating from the node. If this parameter is not provided when creating
a new monitor, then the default value will be 0. a new monitor, then the default value will be 0.
partition:
description:
- Device partition to manage resources on.
default: Common
version_added: 2.5
notes: notes:
- Requires the f5-sdk Python package on the host. This is as easy as pip - Requires the f5-sdk Python package on the host. This is as easy as pip
install f5-sdk. install f5-sdk.
@ -67,53 +83,62 @@ author:
- Tim Rupp (@caphrim007) - Tim Rupp (@caphrim007)
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Create TCP Monitor - name: Create TCP Monitor
bigip_monitor_tcp_half_open: bigip_monitor_tcp_half_open:
state: "present" state: present
ip: "10.10.10.10" ip: 10.10.10.10
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
name: "my_tcp_monitor" name: my_tcp_monitor
delegate_to: localhost delegate_to: localhost
- name: Remove TCP Monitor - name: Remove TCP Monitor
bigip_monitor_tcp_half_open: bigip_monitor_tcp_half_open:
state: "absent" state: absent
server: "lb.mydomain.com" server: lb.mydomain.com
user: "admin" user: admin
password: "secret" password: secret
name: "my_tcp_monitor" name: my_tcp_monitor
delegate_to: localhost
- name: Add half-open monitor for all addresses, port 514
bigip_monitor_tcp_half_open:
server: lb.mydomain.com
user: admin
port: 514
password: secret
name: my_tcp_monitor
delegate_to: localhost delegate_to: localhost
''' '''
RETURN = ''' RETURN = r'''
parent: parent:
description: New parent template of the monitor. description: New parent template of the monitor.
returned: changed returned: changed
type: string type: string
sample: "tcp" sample: tcp
ip: ip:
description: The new IP of IP/port definition. description: The new IP of IP/port definition.
returned: changed returned: changed
type: string type: string
sample: "10.12.13.14" sample: 10.12.13.14
interval: interval:
description: The new interval in which to run the monitor check. description: The new interval in which to run the monitor check.
returned: changed returned: changed
type: int type: int
sample: 2 sample: 2
timeout: timeout:
description: The new timeout in which the remote system must respond to the monitor. description: The new timeout in which the remote system must respond to the monitor.
returned: changed returned: changed
type: int type: int
sample: 10 sample: 10
time_until_up: time_until_up:
description: The new time in which to mark a system as up after first successful response. description: The new time in which to mark a system as up after first successful response.
returned: changed returned: changed
type: int type: int
sample: 2 sample: 2
''' '''
import os import os
@ -128,8 +153,8 @@ from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import AnsibleF5Parameters from ansible.module_utils.f5_utils import AnsibleF5Parameters
from ansible.module_utils.f5_utils import HAS_F5SDK from ansible.module_utils.f5_utils import HAS_F5SDK
from ansible.module_utils.f5_utils import F5ModuleError from ansible.module_utils.f5_utils import F5ModuleError
from ansible.module_utils.f5_utils import iteritems from ansible.module_utils.six import iteritems
from ansible.module_utils.f5_utils import defaultdict from collections import defaultdict
try: try:
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
@ -508,7 +533,7 @@ class ArgumentSpec(object):
self.supports_check_mode = True self.supports_check_mode = True
self.argument_spec = dict( self.argument_spec = dict(
name=dict(required=True), name=dict(required=True),
parent=dict(), parent=dict(default='tcp_half_open'),
ip=dict(), ip=dict(),
port=dict(type='int'), port=dict(type='int'),
interval=dict(type='int'), interval=dict(type='int'),

@ -1,21 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright 2017 F5 Networks Inc. # Copyright (c) 2017 F5 Networks Inc.
# # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public Liccense for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
@ -30,10 +16,10 @@ if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7") raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.compat.tests import unittest from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch, Mock from ansible.compat.tests.mock import Mock
from ansible.compat.tests.mock import patch
from ansible.module_utils.f5_utils import AnsibleF5Client from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import F5ModuleError from ansible.module_utils.f5_utils import F5ModuleError
from units.modules.utils import set_module_args
try: try:
from library.bigip_monitor_tcp import ParametersTcp from library.bigip_monitor_tcp import ParametersTcp
@ -45,6 +31,7 @@ try:
from library.bigip_monitor_tcp import TcpEchoManager from library.bigip_monitor_tcp import TcpEchoManager
from library.bigip_monitor_tcp import TcpHalfOpenManager from library.bigip_monitor_tcp import TcpHalfOpenManager
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
from test.unit.modules.utils import set_module_args
except ImportError: except ImportError:
try: try:
from ansible.modules.network.f5.bigip_monitor_tcp import ParametersTcp from ansible.modules.network.f5.bigip_monitor_tcp import ParametersTcp
@ -56,6 +43,7 @@ except ImportError:
from ansible.modules.network.f5.bigip_monitor_tcp import TcpEchoManager from ansible.modules.network.f5.bigip_monitor_tcp import TcpEchoManager
from ansible.modules.network.f5.bigip_monitor_tcp import TcpHalfOpenManager from ansible.modules.network.f5.bigip_monitor_tcp import TcpHalfOpenManager
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
from units.modules.utils import set_module_args
except ImportError: except ImportError:
raise SkipTest("F5 Ansible modules require the f5-sdk Python library") raise SkipTest("F5 Ansible modules require the f5-sdk Python library")

@ -1,21 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright 2017 F5 Networks Inc. # Copyright (c) 2017 F5 Networks Inc.
# # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public Liccense for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
@ -30,21 +16,26 @@ if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7") raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.compat.tests import unittest from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch, Mock from ansible.compat.tests.mock import Mock
from ansible.compat.tests.mock import patch
from ansible.module_utils.f5_utils import AnsibleF5Client from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import F5ModuleError from ansible.module_utils.f5_utils import F5ModuleError
from units.modules.utils import set_module_args
try: try:
from library.bigip_monitor_tcp_echo import Parameters from library.bigip_monitor_tcp_echo import Parameters
from library.bigip_monitor_tcp_echo import ModuleManager from library.bigip_monitor_tcp_echo import ModuleManager
from library.bigip_monitor_tcp_echo import ArgumentSpec from library.bigip_monitor_tcp_echo import ArgumentSpec
from library.bigip_monitor_tcp_echo import HAS_F5SDK
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
from test.unit.modules.utils import set_module_args
except ImportError: except ImportError:
try: try:
from ansible.modules.network.f5.bigip_monitor_tcp_echo import Parameters 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 ModuleManager
from ansible.modules.network.f5.bigip_monitor_tcp_echo import ArgumentSpec from ansible.modules.network.f5.bigip_monitor_tcp_echo import ArgumentSpec
from ansible.modules.network.f5.bigip_monitor_tcp_echo import HAS_F5SDK
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
from units.modules.utils import set_module_args
except ImportError: except ImportError:
raise SkipTest("F5 Ansible modules require the f5-sdk Python library") raise SkipTest("F5 Ansible modules require the f5-sdk Python library")

@ -1,21 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright 2017 F5 Networks Inc. # Copyright (c) 2017 F5 Networks Inc.
# # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public Liccense for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
@ -30,21 +16,26 @@ if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7") raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.compat.tests import unittest from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch, Mock from ansible.compat.tests.mock import Mock
from ansible.compat.tests.mock import patch
from ansible.module_utils.f5_utils import AnsibleF5Client from ansible.module_utils.f5_utils import AnsibleF5Client
from ansible.module_utils.f5_utils import F5ModuleError from ansible.module_utils.f5_utils import F5ModuleError
from units.modules.utils import set_module_args
try: try:
from library.bigip_monitor_tcp_half_open import Parameters from library.bigip_monitor_tcp_half_open import Parameters
from library.bigip_monitor_tcp_half_open import ModuleManager from library.bigip_monitor_tcp_half_open import ModuleManager
from library.bigip_monitor_tcp_half_open import ArgumentSpec from library.bigip_monitor_tcp_half_open import ArgumentSpec
from library.bigip_monitor_tcp_half_open import HAS_F5SDK
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
from test.unit.modules.utils import set_module_args
except ImportError: except ImportError:
try: try:
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import Parameters 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 ModuleManager
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ArgumentSpec from ansible.modules.network.f5.bigip_monitor_tcp_half_open import ArgumentSpec
from ansible.modules.network.f5.bigip_monitor_tcp_half_open import HAS_F5SDK
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
from units.modules.utils import set_module_args
except ImportError: except ImportError:
raise SkipTest("F5 Ansible modules require the f5-sdk Python library") raise SkipTest("F5 Ansible modules require the f5-sdk Python library")

Loading…
Cancel
Save