|
|
|
@ -15,9 +15,8 @@ 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.module_utils import basic
|
|
|
|
from ansible.compat.tests.mock import patch
|
|
|
|
from ansible.module_utils._text import to_bytes
|
|
|
|
|
|
|
|
from ansible.module_utils.f5_utils import AnsibleF5Client
|
|
|
|
from ansible.module_utils.f5_utils import AnsibleF5Client
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
@ -25,12 +24,14 @@ try:
|
|
|
|
from library.bigip_snat_pool import ModuleManager
|
|
|
|
from library.bigip_snat_pool import ModuleManager
|
|
|
|
from library.bigip_snat_pool import ArgumentSpec
|
|
|
|
from library.bigip_snat_pool import ArgumentSpec
|
|
|
|
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_snat_pool import Parameters
|
|
|
|
from ansible.modules.network.f5.bigip_snat_pool import Parameters
|
|
|
|
from ansible.modules.network.f5.bigip_snat_pool import ModuleManager
|
|
|
|
from ansible.modules.network.f5.bigip_snat_pool import ModuleManager
|
|
|
|
from ansible.modules.network.f5.bigip_snat_pool import ArgumentSpec
|
|
|
|
from ansible.modules.network.f5.bigip_snat_pool import ArgumentSpec
|
|
|
|
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")
|
|
|
|
|
|
|
|
|
|
|
|
@ -38,11 +39,6 @@ fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures')
|
|
|
|
fixture_data = {}
|
|
|
|
fixture_data = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_module_args(args):
|
|
|
|
|
|
|
|
args = json.dumps({'ANSIBLE_MODULE_ARGS': args})
|
|
|
|
|
|
|
|
basic._ANSIBLE_ARGS = to_bytes(args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def load_fixture(name):
|
|
|
|
def load_fixture(name):
|
|
|
|
path = os.path.join(fixture_path, name)
|
|
|
|
path = os.path.join(fixture_path, name)
|
|
|
|
|
|
|
|
|
|
|
|
|