mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Remove f5-sdk from bigip_gtm_wide_ip (#48509)
This commit is contained in:
@@ -15,9 +15,6 @@ from nose.plugins.skip import SkipTest
|
||||
if sys.version_info < (2, 7):
|
||||
raise SkipTest("F5 Ansible modules require Python >= 2.7")
|
||||
|
||||
from units.compat import unittest
|
||||
from units.compat.mock import Mock
|
||||
from units.compat.mock import patch
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
try:
|
||||
@@ -27,9 +24,15 @@ try:
|
||||
from library.modules.bigip_gtm_wide_ip import ArgumentSpec
|
||||
from library.modules.bigip_gtm_wide_ip import UntypedManager
|
||||
from library.modules.bigip_gtm_wide_ip import TypedManager
|
||||
|
||||
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
|
||||
|
||||
# In Ansible 2.8, Ansible changed import paths.
|
||||
from test.units.compat import unittest
|
||||
from test.units.compat.mock import Mock
|
||||
from test.units.compat.mock import patch
|
||||
|
||||
from test.units.modules.utils import set_module_args
|
||||
except ImportError:
|
||||
try:
|
||||
from ansible.modules.network.f5.bigip_gtm_wide_ip import ApiParameters
|
||||
@@ -38,8 +41,14 @@ except ImportError:
|
||||
from ansible.modules.network.f5.bigip_gtm_wide_ip import ArgumentSpec
|
||||
from ansible.modules.network.f5.bigip_gtm_wide_ip import UntypedManager
|
||||
from ansible.modules.network.f5.bigip_gtm_wide_ip import TypedManager
|
||||
|
||||
from ansible.module_utils.network.f5.common import F5ModuleError
|
||||
from ansible.module_utils.network.f5.common import iControlUnexpectedHTTPError
|
||||
|
||||
# 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
|
||||
except ImportError:
|
||||
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
|
||||
@@ -121,6 +130,17 @@ class TestUntypedManager(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.spec = ArgumentSpec()
|
||||
try:
|
||||
self.p1 = patch('library.modules.bigip_gtm_wide_ip.module_provisioned')
|
||||
self.m1 = self.p1.start()
|
||||
self.m1.return_value = True
|
||||
except Exception:
|
||||
self.p1 = patch('ansible.modules.network.f5.bigip_gtm_wide_ip.module_provisioned')
|
||||
self.m1 = self.p1.start()
|
||||
self.m1.return_value = True
|
||||
|
||||
def tearDown(self):
|
||||
self.p1.stop()
|
||||
|
||||
def test_create_wideip(self, *args):
|
||||
set_module_args(dict(
|
||||
@@ -158,6 +178,17 @@ class TestTypedManager(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.spec = ArgumentSpec()
|
||||
try:
|
||||
self.p1 = patch('library.modules.bigip_gtm_wide_ip.module_provisioned')
|
||||
self.m1 = self.p1.start()
|
||||
self.m1.return_value = True
|
||||
except Exception:
|
||||
self.p1 = patch('ansible.modules.network.f5.bigip_gtm_wide_ip.module_provisioned')
|
||||
self.m1 = self.p1.start()
|
||||
self.m1.return_value = True
|
||||
|
||||
def tearDown(self):
|
||||
self.p1.stop()
|
||||
|
||||
def test_create_wideip(self, *args):
|
||||
set_module_args(dict(
|
||||
|
||||
Reference in New Issue
Block a user